Skip to content

Commit a0aa3d4

Browse files
committed
Clarify the use of plain name fragments.
Also clarify that internal referencing allows skipping the process of resolving URI references. Addresses issue #318.
1 parent 737e718 commit a0aa3d4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

jsonschema-core.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,17 @@
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>
465+
<t>
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>
464470
<t>
465471
The effect of defining an "$id" that neither matches the above
466472
requirements nor is a valid JSON pointer is not defined.
@@ -548,7 +554,8 @@
548554
When an implementation then looks inside the &lt;#/items&gt; schema, it
549555
encounters the &lt;#item&gt; reference, and resolves this to
550556
&lt;http://example.net/root.json#item&gt; which is understood as the schema
551-
defined elsewhere in the same document.
557+
defined elsewhere in the same document without needing to
558+
resolve the fragment against the base URI.
552559
</t>
553560
</section>
554561
<section title="External references">

0 commit comments

Comments
 (0)