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
  • #2984
Closed
Open
Issue created May 23, 2019 by Administrator@rootContributor

[Java][Spring] Disable default methods for interfaces

Created by: eriktim

The problem

For our microservices we use the Java Spring OpenAPI generator. When creating a new service:

  • we write an OpenAPI yaml file;
  • we generate interfaces and DTOs using interfaceOnly and java8;
  • we create controllers that implement the interfaces.

This works really well. However, all interfaces have a default implementation (resulting in a HttpStatus.NOT_IMPLEMENTED). These will only give errors on runtime and does not tell me what controller methods I need to implement.

The suggested solution

It would be great to be able to disable the default implementation so that we get errors at compile time showing what methods we need to implement.

Alternatives

The alternative would be to also generate an initial controller which we modify according our needs. Unfortunately, this will not always work when you update an existing interface and we would like to keep generated/manual code separated.

Are there any plan on such a feature?

cc @diyfr

Assignee
Assign to
Time tracking