I am trying to use the Swagger Core JAX-RS 2.0 project to generate 
documentation for my existing webservices. My project is set up so the 
webservices are in one project and the servlets that use the webservices 
are in another project.


I added the dependency for swagger-jaxrs2 to both projects and added the 
following to the web.xml in the servlet project:


    <servlet>
    <!-- use OpenApi servlet to serve spec -->
    <servlet-name>OpenApi</servlet-name>
    <servlet-class>io.swagger.jaxrs2.integration.OpenApiServlet</servlet-class>

    <init-param>
        <param-name>openApi.configuration.resourcePackages</param-name>
        
<param-value>myorg.webservices.resources,myorg.webservices.resources.subpackage1,myorg.webservices.resources.subpackage2</param-value>
    </init-param>
    <!-- alternatively specify configuration file location <init-param> 
<param-name>openApi.configuration.location</param-name> 
        <param-value>/openapi-configuration.json</param-value> </init-param> -->
    <!-- alternatively include a file openapi-configuration.json or 
openapi-configuration.yaml 
        in classpath -->

    <load-on-startup>2</load-on-startup></servlet>
<servlet-mapping>
    <servlet-name>OpenApi</servlet-name>
    <url-pattern>/openapi/*</url-pattern>
</servlet-mapping>


I can run the servlet project and it works, but when I go to /openapi all I 
get is:


{"openapi":"3.0.0"}


I expect to instead see that and a bunch of RESTful webservice 
documentation stubs.


I'm clearly missing something obvious - most of the documentation is for 
Jersey; my project does not use Jersey or really any framework. Is there a 
magic annotation, or am I referring to the classes wrong, or ?


While we're on the subject, do I need to explicitly refer to subpackages, 
or does it recurse into subpackages?

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to