-
Notifications
You must be signed in to change notification settings - Fork 82
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
Open API 3.1 Conditional Schemas #567
Comments
At the moment, I think we have to support everything from the OpenAPI 3.1 spec, which would include both I think at a minimum we would want to allow:
However, we could also add new annotations or add to existing ones. @manstis Did you have any examples of what you'd want to be able to do in your code to add these properties to the final OpenAPI document? |
Hi @Azquelt I forget the exact details other than some notes I captured at the time:
The issue was that a library is being used to generate forms from JSON schemas. If the JSON schemas defined dependencies (on other schemas) they failed to be recognised and the generated forms incomplete. I've moved onto other projects now; but can try to answer any questions you have ongoing. |
Ok, so checking through what was written above, my understanding is:
In #584 , we've made several changes which I think address this:
Based on the above, I think the features being added in 4.0 are sufficient to close this issue, but do feel free to reopen if I've missed anything. |
Will there be support to define conditional schemas?
The OpenAPI 3.1 Specification suggests
"For more information about the properties, see JSON Schema Core and JSON Schema Validation."
https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-10.2.2
Both referenced documents cover
dependencies
and/ordependentSchemas
.The older Open API 3.0.x Specification implicitly states conditional schemas are unsupported.
"Additional properties defined by the JSON Schema specification that are not mentioned here are strictly unsupported".
No such comment is made for 3.1 so it could be assumed they are supported.
It is useful for consumers of Open API when used, for example, to generate User input forms programmatically.
The text was updated successfully, but these errors were encountered: