java - Guide to use Restlet Swagger extension for GAE -
i tried similar approach:
public restlet createinboundroot() { router apirouter = createapirouter(); attachswaggerspecificationrestlet(apirouter, "/api-docs"); return apirouter; }
when /api-docs
access restlet throws error 404, messing. idea apirouter have working @ state, when acess resource /stuff
etc.
what missing in code? or there specific notes take consideration when using restlet swagger extension gae?
i tested usecase , can make work swagger extension following maven configuration (restlet-version
= 2.3.1)ae dev server:
<dependencies> <dependency> <groupid>org.restlet.gae</groupid> <artifactid>org.restlet</artifactid> <version>${restlet-version}</version> </dependency> <dependency> <groupid>org.restlet.gae</groupid> <artifactid>org.restlet.ext.servlet</artifactid> <version>${restlet-version}</version> </dependency> <dependency> <groupid>org.restlet.gae</groupid> <artifactid>org.restlet.ext.swagger</artifactid> <version>${restlet-version}</version> <exclusions> <exclusion> <groupid>org.raml</groupid> <artifactid>raml-parser</artifactid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.restlet.jse</groupid> <artifactid>org.restlet.ext.jetty</artifactid> <version>${restlet-version}</version> </dependency> </dependencies>
you can notice had exclude raml parser within ext.swagger
.
here code of restlet application:
public class restletapplication extends swaggerapplication { @override public restlet createinboundroot() { router router = new router(getcontext()); router.attach("/ping", myserverresource.class); attachswaggerspecificationrestlet(router, "/docs"); return router; } }
if can you, can provide test project within github repository.
hope helps you
Comments
Post a Comment