Skip to content

Clarify the use of plain name fragments. #356

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

Merged
merged 2 commits into from
Aug 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions jsonschema-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,21 @@
<t>
To name subschemas in a JSON Schema document,
subschemas can use "$id" to give themselves a document-local identifier.
This is done by setting "$id" to a URI reference consisting only of a fragment.
This is done by setting "$id" to a URI reference consisting
only of a plain name fragment (not a JSON Pointer fragment).
The fragment identifier MUST begin with a letter ([A-Za-z]), followed by
any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons
(":"), or periods (".").
</t>
<t>
The effect of defining an "$id" that neither matches the above
requirements nor is a valid JSON pointer is not defined.
Providing a plain name fragment enables a subschema to be
relocated within a schema without requiring that JSON
Pointer references are updated.
</t>
<t>
The effect of defining a URI fragment "$id" that neither
matches the above requirements nor is a valid JSON pointer
is not defined.
</t>
<t>
For example:
Expand Down Expand Up @@ -548,7 +555,8 @@
When an implementation then looks inside the &lt;#/items&gt; schema, it
encounters the &lt;#item&gt; reference, and resolves this to
&lt;http://example.net/root.json#item&gt; which is understood as the schema
defined elsewhere in the same document.
defined elsewhere in the same document without needing to
resolve the fragment against the base URI.
</t>
</section>
<section title="External references">
Expand Down