OpenAPITools / OpenAPITools/openapi-generator
[BUG][JAXRS-spec] useOneOfInterfaces option causes compilation error
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
When using the useOneOfInterfaces option, the generated code does not compile.
Children classes are OK, but the generated parent is a class instead of an interface.
openapi-generator version
I've reproduces the issue with openapi-generator-maven-plugin :
7.0.1, 7.1.0
6.6.0
The option does not seem supported on previous releases.
OpenAPI declaration file content or url
OpenAPI spec :
https://gist.github.com/jerui1/da605832f67667e32a96f5c4d346640e
Sample maven project to reproduce :
Generation Details
mvn clean install
(I've tried using Java 17 or Java 21)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked OpenAPI declaration and the openapigen-oneofbug.zip sample project, then run mvn clean install with the JAXRS-spec useOneOfInterfaces option. Inspect the generated parent and child classes; done means the generated parent is an interface where expected and the Maven project compiles successfully on the reported Java versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100