How do we support future versions of JSON-Schema? What if there are breaking changes?
Should we support other Schemas?
Can we define a mapping between OpenAPI Schema and other schemas?
How does this issue fit with the review of the OAI charter?
From the JSON Schema project's perspective, here are some key points. None of this is an attempt to dissuade OAI from supporting other schema systems. JSON Schema will never be everything to everyone (nor will any other system).
_NOTE: I am promising some things that I haven't 100% sold the rest of the JSON Schema project members on, but I'm fairly confident that we will get these things done somehow. Also, OAS putting some weight behind things would make them easier to sell!_
deprecated$schema may change, but OAS doesn't use it so that's finenullable needs to be addressed, hopefully per #1389 as changing this on the JSON Schema side would be a very major breaking change for us, and the approaches _cannot_ easily co-existexamples (plural) rather than example (singular), but these _can_ easily co-existdiscriminator (at least for us :-), although the approaches can co-existadditionalProperties and allOf _should_ be part of draft-08I know that during the development of OAS 3.0, JSON Schema was still a mostly moribund project. draft-wright-*-01 was published right near the end, but since it was a bug fix we still had not shown that we were really moving forward. We have now published three drafts on a roughly six-month timeline, and are pretty far along in making decisions for a fourth.
Please bring up any concerns that you may have given up on simply because there was no one available to work on them on the JSON Schema side, or because JSON Schema editors who have left the project declined to address them years ago.
The OAS community makes up a substantial percentage of the JSON Schema community, and it is in our best interests to ensure that your use cases are supported as best we can.
Looking forward to the fix for Composition and Inheritance.
The major components of draft-08 have been more or less settled on, and anyone can track progress with the draft-08 milestone
Of particular relevance are:
unevaluatedProperties)I would particularly encourage feedback from OpenAPI users on 561 as it lays the groundwork for fixing things like composition vs inheritance.
You don't need to follow all of it, but since there's still some debate over how much additional vocabularies would be used, a bunch of thumbsup or similar, or comments about how you would have a use for making additional properties more manageable and interoperable would be a big help.
I hope to publish draft-08 by the end of May, and absolutely no later than the end of June.
We're still a little way off on publishing draft-8, but we're continuing to make progress! =]
I would love to be able to declare the version of JSON Schema to draft-07 (or draft-08 when available).
There isn't much contradiction left to resolve
There's also the change of exclusiveMinimum and exclusiveMaximum from boolean to number:
Changed "exclusiveMaximum"/"exclusiveMinimum" from boolean modifiers of "maximum"/"minimum" to independent numeric fields.
That's how I found the difference between the current OpenAPI JSON Schema version used and the current "latest": https://github.com/tiangolo/fastapi/issues/240
My specific use case is that FastAPI generates OpenAPI schemas from application code. For the JSON Schemas it uses Pydantic, and Pydantic generates JSON Schema with draft-07.
So, I'm already generating OpenAPI with JSON Schema draft-07. I would love to have a way to declare the version of JSON Schema explicitly.
JSON Schema v2019-09 has been published
Most helpful comment
From the JSON Schema project's perspective, here are some key points. None of this is an attempt to dissuade OAI from supporting other schema systems. JSON Schema will never be everything to everyone (nor will any other system).
_NOTE: I am promising some things that I haven't 100% sold the rest of the JSON Schema project members on, but I'm fairly confident that we will get these things done somehow. Also, OAS putting some weight behind things would make them easier to sell!_
We don't expect to break existing core and validation keywords
deprecated$schemamay change, but OAS doesn't use it so that's fineThere isn't much contradiction left to resolve
nullableneeds to be addressed, hopefully per #1389 as changing this on the JSON Schema side would be a very major breaking change for us, and the approaches _cannot_ easily co-existexamples(plural) rather thanexample(singular), but these _can_ easily co-existdraft-08 will substantially improve modularity and extensibility
We will fix the "Composition and Inheritance" awkwardness
discriminator(at least for us :-), although the approaches can co-existadditionalPropertiesandallOf_should_ be part of draft-08We are very interested in addressing concerns from OAS
I know that during the development of OAS 3.0, JSON Schema was still a mostly moribund project. draft-wright-*-01 was published right near the end, but since it was a bug fix we still had not shown that we were really moving forward. We have now published three drafts on a roughly six-month timeline, and are pretty far along in making decisions for a fourth.
Please bring up any concerns that you may have given up on simply because there was no one available to work on them on the JSON Schema side, or because JSON Schema editors who have left the project declined to address them years ago.
The OAS community makes up a substantial percentage of the JSON Schema community, and it is in our best interests to ensure that your use cases are supported as best we can.