-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Move core examples/best practices to appendixes #791
Conversation
RFC NNNN - Keyword definitions for normative sections of RFC documents... 😉 |
I feel like I'm missing something or not getting the joke? Am I supposed to do something with this? |
The two commits I just added are:
So all of this PR has still been approved, although additional feedback is welcome and it can't be merged until after #780 is merged. |
Now also includes the commits from #792, which were approved by @Relequestual and @philsturgeon. I'm just trying to tidy up the stacked PRs while we wait for the final reviews. |
Sorry, just a joke. Should have included emoji =] |
These sections are not normative (RFC 2119 terms will be removed in a subsequent commit), and moving them to an appendix reduces the length of the sizable normative portion of the spec. And also improves flow, I think. The examples within core tend to rely on understanding more of the core keywords than have necessarily been introduced, so they work better after the entire vocabulary has been introduced.
Vocabulary authorship is not part of the JSON Schema specification, so this guidance should not use RFC 2119 terms.
This is going to be a powerful technique for generative use cases, which have been observed either requiring references (as opposed to subschemas) in certain places, or implementing various sorts of inferencing around references on their own or in conjunction with other keywords. For example, one OpenAPI documentation tool assumes that in an "allOf" of several references, the first is a base class of some sort. While this is not correct behavior by either JSON Schema or OpenAPI, it demonstrates a feature built by making implicit assumptions about certain references. This section provides a recommendation for making such behavior explicit, and also guides writers of such tools to the concept of extension vocabularies and annotations.
This should make clear what use cases are considered valid and safe, vs when someone is on their own in terms of figuring that out.
Co-Authored-By: Phil Sturgeon <[email protected]>
176fdba
to
7e982af
Compare
NOTE: The first commit is just a move, the second changes the RFC 2119 terms. They should be examined separately.
These sections are not normative, and moving them to an
appendix reduces the length of the sizable normative
portion of the spec. And also improves flow, I think.
The examples within core tend to rely on understanding more
of the core keywords than have necessarily been introduced,
so they work better after the entire vocabulary has been
introduced.
Vocabulary authorship is not part of the JSON Schema specification,
so this guidance should not use RFC 2119 terms.