Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Update Schema Objects to JSON Schema Draft 2019-09 #1977
Update Schema Objects to JSON Schema Draft 2019-09 #1977
Changes from 1 commit
ac236d1
f8f92ed
e121405
5905f45
4822592
d67f350
bb9a6f2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "a JSON Schema vocabulary"? is it a fork of the "JSON Schema vocabulary"? if so, shouldn't we call it the "OpenAPI vocabulary" as it is referred down below?
Where will this vocabulary be located? Can we see it? It would be nice to link it here, especially if tooling is required to support it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A "JSON Schema vocabulary" is a specification which defines a set of keywords which have specific semantic meaning when applying a JSON Schema to a JSON instance.
A JSON Shema meta-schema defines the known vocabularies and if support for them is required in order to process the document.
You can see this in practice by looking at the General-purpose meta-schema for draft
2019-09
at http://json-schema.org/specification.htmlThe URI used as the vocabulary identifier, as like with $id, is not necessarily network addressable, and in the case of vocabularies, the identifier URI as a resources is reserved but not defined.
If you'd like to talk about this in more detail, feel free to come by the JSON Schema slack server, or reach out to any of the core team =]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the mechanics. I guess where I want to get with this is: how will this look like when implementing this (practically-speaking). How will one be able to support OpenAPI Schemas using the vocabulary mechanism if none is provided (in this repo)? Will this mean it will be up to the implementor to maintain their own OpenAPI Schema vocabulary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstoiko I'm not sure why you think none will be provided. This is about updating a certain part of the specification document to conform to
2019-09
. It is not a PR to finalize every aspect of every issue related to updating JSON Schema ever. There are various other issues and PRs filed. PR #2016 in particular shows a first pass at a vocabulary meta-schema.Please don't burden this PR with more work than it is already doing. It is already doing a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "vocabulary" IS the specification document which defines the additional keywords.
An implementer will implement a given vocabulary. There are implementations which DO stuff with OAS 3.0 flavour JSON Schema already, right?
An implementer will not "maintain a vocabulary". They may maintain a library which supports the vocabulary. As @handrews that, and a meta-schema for any potential vocabulary, is way beyond the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s no such thing as a vocabulary file so we’re good here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. #2016 shows one possible meta-schema for the vocabulary, with a vocabulary URI that I just made up. The TSC may prefer to URI to either be a pure identifier, be the URI for the Schema Object specification, or be an identifier which redirects to the specification (which is more or less what we're doing with the official JSON Schema vocabulary URIs right now, although limitations of GitHub pages mean it's done in a slightly weird way using an HTML refresh https://json-schema.org/draft/2019-09/vocab/applicator ).
The recommendation in the JSON Schema spec is that vocabulary URIs be pure identifiers, with the idea being that we can add a formal vocabulary file type later. But that seems to confuse people too much so redirecting to the relevant specification is probably best for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggestion aligns the
nullable
language with the OAS 3.0.3 language from PR #2046, with minimal wording tweaks to account fortype
now being able to have multiple values (type arrays).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to apply this suggestion, so its over here #2124