-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JAVA] oneOf implementation: wrong discriminator values and discriminator field #197
Comments
Thank you a lot for this report! Maybe we should try to just fix it as you have proposed. On the long run, as I told in #15 I think that |
Well, in my example, Genre is a superclass cause by "allOf" property On the other side , I agree with you: "oneOf" should be implemented with an interface GenreType , in my example (names could not be the best choice ) So:
And
I think the discriminator field shouldn't have a settter method ( maybe, discriminator field should be final ) Same for Female clase, except setting
And Person.java
And JSON.java
|
Well from a OpenAPI Specification point of view, there is nothing that specify that |
…onorepo chore(deps): update nrwl monorepo to v11.0.18
Description
When JSON.java code is generated for an oneOf property, it is set wrong discriminator values,
and discriminator field is set empty
openapi-generator version
openapi-generator-cli-3.0.0 (SNAPSHOT 20180531.120113-109)
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
After generation according step before , JSON.java class includes the next code
Related issues/PRs
Improve handling of oneOf #15
Suggest a fix/enhancement
I think that it should be:
So,
The text was updated successfully, but these errors were encountered: