Skip to content

Commit 286283f

Browse files
authored
Merge pull request #356 from handrews/internal
Clarify the use of plain name fragments.
2 parents 22a10fb + f563f1c commit 286283f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

jsonschema-core.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,21 @@
456456
<t>
457457
To name subschemas in a JSON Schema document,
458458
subschemas can use "$id" to give themselves a document-local identifier.
459-
This is done by setting "$id" to a URI reference consisting only of a fragment.
459+
This is done by setting "$id" to a URI reference consisting
460+
only of a plain name fragment (not a JSON Pointer fragment).
460461
The fragment identifier MUST begin with a letter ([A-Za-z]), followed by
461462
any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons
462463
(":"), or periods (".").
463464
</t>
464465
<t>
465-
The effect of defining an "$id" that neither matches the above
466-
requirements nor is a valid JSON pointer is not defined.
466+
Providing a plain name fragment enables a subschema to be
467+
relocated within a schema without requiring that JSON
468+
Pointer references are updated.
469+
</t>
470+
<t>
471+
The effect of defining a URI fragment "$id" that neither
472+
matches the above requirements nor is a valid JSON pointer
473+
is not defined.
467474
</t>
468475
<t>
469476
For example:
@@ -548,7 +555,8 @@
548555
When an implementation then looks inside the &lt;#/items&gt; schema, it
549556
encounters the &lt;#item&gt; reference, and resolves this to
550557
&lt;http://example.net/root.json#item&gt; which is understood as the schema
551-
defined elsewhere in the same document.
558+
defined elsewhere in the same document without needing to
559+
resolve the fragment against the base URI.
552560
</t>
553561
</section>
554562
<section title="External references">

0 commit comments

Comments
 (0)