-
Notifications
You must be signed in to change notification settings - Fork 402
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
Examples of oneOf keyword are incorrect #253
Comments
|
Hi, this was recently reported to OpenAPI asking for clarification (OAI/OpenAPI-Specification#3477). Does this project accept PRs? |
This had been confusing me... I don't see this repo containing that page, so I assume the community is not able to correct that. |
See somehow related #348 |
The documentation that describes the oneOf keyword has wrong examples in it.
The specification looks like this:
There are three examples:
Correction: The JSON object is valid for NOT ONLY one of the schemas. It indeed has the two properties of
Dog
, but it is also valid aginstCat
, asCat
has no required properties defined AND it also allows additionalProperties. (additionalProperties defaults to true according to https://swagger.io/specification/). So the validation will fail.Correction: The JSON object is VALID against both schemas because neither
Dog
norCat
defines required properties and both allow additional properties by default. So the validation will fail.Correction: The statement above is true, but the example is misleading. It is not valid for both schemas because it contains both schemas' properties. It is valid against both schemas because both
Dog
andCat
allow additional properties by default.The text was updated successfully, but these errors were encountered: