-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Open
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
Description
- I know this issue might have been raised in the past few years for several times. I have a simple openapi spec with 1 GET point to return a
OneOftype of response. The generated code does not compile. - My spec is return a
contact-infowhich is either aemailor atelephoneNumber. - The generated code for
contact-infois referring a class namedOneOftelephoneNumberemail. But that class is not generated. And the maven compile failed. - the same problem also show up for
anyOfdefinition.
openapi-generator version
I have tried many versions including the latest release 5.1.1 and the 5.2.0-SNAPSHOT. This error shows up on all the versions.
OpenAPI declaration file content or url
https://github.com/bnlcnd/poc-anyof-oneof/blob/main/anyof-oneof.yaml
Generation Details
the POM file can be found here
https://github.com/bnlcnd/poc-anyof-oneof/blob/main/pom.xml
Steps to reproduce
- git clone the repository https://github.com/bnlcnd/poc-anyof-oneof
- run the command under the root folder of the repo :
mvn clean package
Suggest a fix
This issue seems lingering around for several years. Maybe it's time to fix it for both oneOf and anyOf.
Reactions are currently unavailable