How to generate Swagger UI from javadocs?
Asked Answered
S

1

12

I can generate swagger UI on my Spring boot application from @Api @ApiOperation, @ApiResponses annotations.

These annotations makes code a bit dirty. I wonder, how I can generate swagger documentation for my API-endpoints from javadocs.

Septima answered 27/6, 2019 at 9:42 Comment(4)
What do you mean by javadoc? I know javadoc but I don't understand how you could use javadoc to generate a swagger/openapi specification?Accepter
@petet I mean generate from comments on top of each controller method.Septima
Related: Using Javadocs to generate Swagger documentAliped
Does this answer your question? Using Javadocs to generate Swagger documentSconce
C
0

Short answer - No, not really.

Longer answer: Swagger files contains much more information than the code - for example @ApiOperation as you already mentioned. I would recommend to stick with Swagger Maven Plugin that I assume you already use. Our team have tried to auto-generate clients to run API tests against the generated swagger file, and so far spring-fox and other solutions doesn't come close to swagger-maven-plugin or hand coding the file.

Chappie answered 24/10, 2023 at 19:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.