Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #9219
Closed
Open
Issue created Apr 09, 2021 by Administrator@rootContributor

[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.

Assignee
Assign to
Time tracking