0

how can I organize the swagger annotations, for example I have an endpoint that catches all the users, so the swagger statements were huge. Is there any way I can organize this in another file to be more organized?

enter image description here

1 Answers1

1

One of strategies often used is creating an interface (e.g. PersonApi in your case) and moving all swagger annotations there. The actual controller should implement this interface.

In regard to the error responses: you may consider adding them programatically to all operations/endpoints using OpenApiCustomiser.

Mafor
  • 9,668
  • 2
  • 21
  • 36