[REQ] (Server side) Java Class per endpoint
Created by: pablobastidasv
Is your feature request related to a problem? Please describe.
The way the API interfaces are generated created Low cohesion with Clean Architecture business logic approaches.
I'm always frustrated when trying to implement the interface generated by the openapi-generator
when my business logic is following clean architecture principles where each User Case is done in an independent class. As the generated API contains many methods, my controller implementation will depend on many classes what makes it have low cohesion and coupling with different use case classes (also mappers, DTO, etc).
Describe the solution you'd like
I would like a similar behavior to the one we have with the useTags
option.
It could be a property called interfacePerEndpoint
that generates a class/interface per each endpoint named with the OperationId or a "generic name" with a method called execute
or run
or do
etc, that contains the related annotations and receive the information.
Describe alternatives you've considered
The usage of useTags
and creating a tag per endpoint looks to give the result I expect in the generated code, but the problem with this approach is the Swagger-UI that is generated, the visual that comes from a spec with this approach has a lot of nonmeaningful groups (One per tag) with only one endpoint.
The other approach that we are thinking of is to create the implementation without extending from the generated Api interface and using the generated Models, but with this approach could miss updates on the specification and we will be misusing what openapi-generator provides us.