r/SpringBoot • • Sep 09 '24

Too many annotations Swagger

I'm working on a Spring Boot project and using Swagger for API documentation. For my DTOs, I've been adding a lot of @Schema annotations to define the API schema properly, but it feels like it's really polluting my code and making the DTOs harder to read.

Is this a common issue, or am I overusing annotations? Are there better practices for integrating Swagger without cluttering the code too much? Any suggestions or alternatives would be appreciated!

25 Upvotes

17 comments sorted by

View all comments

1

u/wimdeblauwe Sep 12 '24

That is the main reason I use Spring REST docs instead.