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
  • #4257
Closed
Open
Issue created Oct 24, 2019 by Administrator@rootContributor

[REQ] Make java-undertow-server generate subclassable Handlers

Created by: LoveIsGrief

Is your feature request related to a problem? Please describe.

The generated PathHandlerProvider.java doesn't provide a method using it as "lib". It isn't just something can generate, subclass and use without modifying the generated files, which means that all modifications will be overwritten as soon as the spec is changed.

Describe the solution you'd like

It would be great if the HttpHandlers used in PathHandlerProvider could be subclassed in custom code. What I'm thinking of is generating an abstract class OperationNameHttpHandler per operation that's subclassed in the same package, then imported and instantiated in PathHandlerProvider e.g

/pet:POST with the operationId addPet will generated the class org.apitools.handler.AddPetBaseHandler and PathHandlerProvider will use AddPetHandlerImpl.

The project won't build until an implementation for AddPetHandlerImpl is provided.

Describe alternatives you've considered

One could also provide a method PathHandlerProvider::addHandler(String operationId, HttpHandler handler) that adds handlers to a Map which are then used in the existing PathHandlerProvider::getHandler.

Additional context

Assignee
Assign to
Time tracking