piyusht007
4 years agoOccasional Visitor
Need to generate API Docs for plain Servlet
Hi,
I am trying this example: https://github.com/swagger-api/swagger-samples/blob/master/java/java-servlet to configure swagger with servlet.
Following this Servlet class from the example, I tried to configure my servlet class as well.
However the generated swagger.json only contains SwaggerDefinition and not scanning other annotations such as Api , @ApiOperation , @ApiImplicitParams , @ApiImplicitParam
Below is the swagger.json for reference:
{"swagger":"2.0","info":{"description":"This is a sample server","version":"1.0.0","title":"Swagger Sample Servlet","termsOfService":"http://swagger.io/terms/","contact":{"name":"Sponge-Bob","url":"http://swagger.io","email":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"tags":[{"name":"users","description":"Operations about user"}],"schemes":["http","https"],"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"]}
Do we have any pointers to this? Also, is there a maven plugin like https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-maven-plugin to generate the spec at BUILD phase for SERVLETS?
Any help is appreciated !!!