Feature - Generate Docs For Services Without Swagger Annotations
See original GitHub issueMy team is using this plugin in one of our projects, and we’ve been very pleased with it. One of the features we really appreciate is the ability for the plugin to use reflection as a fallback in cases where a service doesn’t have very good Swagger documentation.
With that said, we would like to expand this plugin to support older services that aren’t using Swagger annotations at all. Since the plugin already has robust support for reflection, I think this this would be a pretty simple task. Instead of scanning for classes with @Api
and methods with @ApiOperation
, we would scan for @Path
and @GET
, @PUT
, etc. (for JAX-RS) or @RestController
and @RequestMapping
(for SpringMvc).
Does the team feel like this would be a useful feature and within the project’s scope? I know that Swagger is the industry standard and most developers should be using it, but my team would like to be able to support services that (for whatever reason) have chosen not to use Swagger.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top GitHub Comments
@who @kongchen Can you weigh in on this? I have a solution for this and can submit a PR. Essentially, my solution would scan for all classes annotated with
@Path
(for JAX-RS) or@RestController
(for Spring MVC) and add them to the doc, treating@Api
and@ApiOperation
as optional.@packleader , I am looking for same feature. I can see PR is merged, is this available in version 3.1.0?
I have classes annotated with @Service and @Path annotations but still, swagger is not generating without adding @Api annotation to class. Do we need that?
My existing classes have @Service annotation from Spring and @Path annotation from Javax.rs. and I tried springmvc as both true and false but that didn’t worked.
Am I missing anything in configuration or this is still an issue? I am fine to annotate classes with @Api annotation but can’t annotate every single method with @ApiOperation annotation.