Skip to content
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

Add support for x-oas-draft-alternateSchemas #861

Open
lsorber opened this issue Jan 29, 2019 · 0 comments
Open

Add support for x-oas-draft-alternateSchemas #861

lsorber opened this issue Jan 29, 2019 · 0 comments

Comments

@lsorber
Copy link

lsorber commented Jan 29, 2019

OpenAPI lags behind JSON Schema, which means OpenAPI APIs do not benefit from the latest fixes and improvements to the latter.

For example:

  1. JSON Schema Draft 4's patternProperties is not supported in OpenAPI, even though the latter is based on Draft 5 (Add support for patternProperties in schemas OAI/OpenAPI-Specification#687).
  2. additionalProperties: false is not compatible with OpenAPI's inheritance model using allOf [1]. This is blocking for strict validation of JSON request bodies that depend on inheritance (JSON request bodies are not strictly validated #837).
  3. Similar issues exist when combining nullable, readOnly, and writeOnly with OpenAPI's inheritance model.

It would be nice if we could already use x-oas-draft-alternateSchemas to specify other schemas to address some of these issues, until alternativeSchema is available in OpenAPI 3.1 (OAI/OpenAPI-Specification#1736).

Related issue: Redocly/redoc#482

[1] https://stackoverflow.com/questions/22689900/json-schema-allof-with-additionalproperties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants