-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[BUG] Java/Spring generator wrongly emits warnings related to oneOf discriminator #17893
Open
5 of 6 tasks
Labels
Comments
This is simpler:
|
It might be - but the structure i'm using is taken from the official documentation. |
I've looked in the code. It visits recursively all the children to find the discriminator.
I'll try to create a PR |
6 tasks
I think #15298 fix this issue |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report Checklist
Description
Java/Spring generator wrongly emits warnings related to oneOf discriminator:
[WARNING] 'getPets_request' defines discriminator 'pet_type', but the referenced schema 'Cat' is incorrect. pet_type is missing from the schema, define it as required and type string [WARNING] 'getPets_request' defines discriminator 'pet_type', but the referenced schema 'Dog' is incorrect. pet_type is missing from the schema, define it as required and type string
Expected output:
Valid generated pojo models
No misleading warnings related to oneOf 'pet_type' discriminator.
Actual output:
Valid generated pojo models.
Misleading warnings related to oneOf 'pet_type' discriminator.
openapi-generator version
7.3.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
A Maven project to reproduce the issue is attached
openapi-one-of-warning-bug.zip
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: