-
Notifications
You must be signed in to change notification settings - Fork 331
oneOf with discriminator does not verify json correctly #1087
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
Comments
The behavior looks correct to me as the discriminator doesn't affect the validation outcome of oneOf. |
Thanks for looking into this. I don't entirely agree that it shouldn't affect the validation. It should assist with validation and indicate which
In the example I posted, both types If this isn't happening, successful validation can only be achieved when the |
From the spec clarifications it doesn't appear that what you are asking for is compliant with the spec. If you look at the current wording in https://github.com/OAI/OpenAPI-Specification/blob/v3.1.1-dev/versions/3.1.1.md it says
You can ask in https://github.com/OAI/OpenAPI-Specification/issues if you think my interpretation is incorrect. |
Found this discussion which seems to confirm that Thanks for taking time to respond! |
Given this schema to highlight the problem
TypeA
andTypeB
are essentially the same with the difference that there is discriminatorkind
is registered with given mappingA
andB
.Then following json cannot be validated
Validator provides this error
The text was updated successfully, but these errors were encountered: