-
-
Notifications
You must be signed in to change notification settings - Fork 347
Clarify the nature of schema placeholder keywords #783
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,7 +307,7 @@ | |
<t> | ||
Object properties that are applied to the instance are called keywords, | ||
or schema keywords. Broadly speaking, keywords fall into one | ||
of three categories: | ||
of four categories: | ||
<list style="hanging"> | ||
<t hangText="assertions:"> | ||
produce a boolean result when applied to an instance | ||
|
@@ -319,6 +319,10 @@ | |
apply one or more subschemas to a particular location | ||
in the instance, and combine or modify their results | ||
</t> | ||
<t hangText="reserved locations:"> | ||
do not directly affect results, but reserve a place | ||
for a specific purpose to ensure interoperability | ||
</t> | ||
</list> | ||
</t> | ||
<t> | ||
|
@@ -1004,6 +1008,22 @@ | |
</section> | ||
</section> | ||
</section> | ||
<section title="Reserved Locations"> | ||
<t> | ||
A fourth category of keywords simply reserve a location to hold re-usable | ||
components or data of interest to schema authors that is not suitable | ||
for re-use. These keywords do not affect validation or annotation results. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I'd suggest to use the term placeholder keyword at least once, maybe even emphasized. For example:
Then when the term placeholder keyword is used further down below such as in section References to Possible Non-Schemas it is terminologically clear that placeholder keywords is the phrase used to refer to keywords falling into the category of reserved locations. Overall the recent additions make things much more consistent and comprehensible, I think. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I'd actually meant to get rid of "placeholder" and use the "location" terminology. I'll sort that out and fix the out-of-order wording, too- thanks! |
||
Their purpose in the core vocabulary is to ensure that locations are | ||
available for certain purposes and will not be redefined by extension | ||
keywords. | ||
</t> | ||
<t> | ||
While these keywords do not directly affect results, as explained in section | ||
<xref target="non-schemas" format="counter"></xref> unrecognized | ||
extension keywords that reserve locations for re-usable schemas may have | ||
undesirable interactions with references in certain circumstances. | ||
</t> | ||
</section> | ||
</section> | ||
<section title="The JSON Schema Core Vocabulary"> | ||
<t> | ||
|
@@ -1848,10 +1868,12 @@ | |
</t> | ||
</section> | ||
|
||
<section title="References to Possible Non-Schemas"> | ||
<section title="References to Possible Non-Schemas" anchor="non-schemas"> | ||
<t> | ||
Subschema objects (or booleans) are recognized by their use with known | ||
applicator keywords. These keywords may be the standard applicators | ||
applicator keywords or with location-reserving keywords such as | ||
<xref target="defs">"$defs"</xref> that take one or more subschemas | ||
as a value. These keywords may be "$defs" and the standard applicators | ||
from this document, or extension keywords from a known vocabulary, or | ||
implementation-specific custom keywords. | ||
</t> | ||
|
@@ -1973,9 +1995,9 @@ | |
</section> | ||
</section> | ||
|
||
<section title='Schema Re-Use With "$defs"'> | ||
<section title='Schema Re-Use With "$defs"' anchor="defs"> | ||
<t> | ||
The "$defs" keyword provides a standardized location for schema | ||
The "$defs" keyword reserves a location for schema | ||
authors to inline re-usable JSON Schemas into a more general schema. | ||
The keyword does not directly affect the validation result. | ||
</t> | ||
|
@@ -2010,8 +2032,8 @@ | |
|
||
<section title='Comments With "$comment"'> | ||
<t> | ||
This keyword is reserved for comments from schema authors to readers or | ||
maintainers of the schema. | ||
This keyword reserves a location for comments from schema authors | ||
to readers or maintainers of the schema. | ||
|
||
The value of this keyword MUST be a string. Implementations MUST NOT present this | ||
string to end users. Tools for editing schemas SHOULD support displaying and | ||
|