[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
andjava8
; - 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