From: Ron S. <rs...@re...> - 2015-09-17 17:00:46
|
Hi Ari, Are you using Resteasy 3.x? If so, "resteasy.scan" is no longer supported. If you annotate your Application with @ApplicationPath, your WAR will be scanned automatically. See Section 3.4 "Configuring in JBoss AS 7, EAP, and Wildfly"(http://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html_single/#javax.ws.rs.core.Application) in the Resteasy user guide. -Ron On 08/03/2015 02:00 PM, Ari King wrote: > Hi, > > I'm having a bit of trouble integrating swagger > <https://github.com/swagger-api/swagger-core> with my resteasy based > API and I believe the issue stems from the configuration, specifically > provider and resource identification. I'd appreciate help in sorting > out the issue. > > From what I understand from the swagger docs > <https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5#automatic-scanning-and-registration>, > I need to do two things: > > 1. Set "resteasy.scan" to true, so swagger's providers and resources > will be automatically picked up. > <https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5#automatic-scanning-and-registration> > > > Since I'm using Guice and an embedded undertow container, I created an > "javax.ws.rs.core.Application" subclass that returns empty sets for > both "classes" and "singletons" -- therefore resteasy should > automatically scan for providers and resources, correct? > > 2. Add "BeanConfig" to my "Application" subclass. > <https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5#using-the-application-class> > > > (For completeness, I included this point as well, but I suspect the > issue with point #1) > > I included the following in the class constructor: > > BeanConfig beanConfig = new BeanConfig(); > beanConfig.setVersion("1.0"); > beanConfig.setHost("0.0.0.0:8080 <http://0.0.0.0:8080>"); > beanConfig.setBasePath("/docs"); > beanConfig.setTitle("API Docs"); > beanConfig.setPrettyPrint(true); > beanConfig.setResourcePackage("co.example.resources"); > beanConfig.setScan(true); > > >From the above the json and yaml docs should be at > http://127.0.0.1:8080/docs/swagger.[json|yaml] > <http://127.0.0.1:8080/docs/swagger.[json%7Cyaml]> but I currently get > javax.ws.rs.NotFoundException: Could not find resource for full path: > http://127.0.0.1:8080/docs/swagger.json > > Thanks. > > -Ari > > > > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |