Skip to content

Commit afca53d

Browse files
handrewsRelequestual
authored andcommitted
Update based on review feedback.
1 parent 4f9e8be commit afca53d

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

jsonschema-core.xml

+30-16
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,24 @@
427427
A JSON Schema resource is a schema which is
428428
<xref target="RFC6596">canonically</xref> identified by an
429429
<xref target="RFC3986">absolute URI</xref>. Schema resources MAY
430-
also be identified by URIs including fragments. Any such URIs
431-
are considered to be non-canonical.
430+
also be identified by URIs, including URIs with fragments,
431+
if the resulting secondary resource (as defined by
432+
<xref target="RFC3986">section 3.5 of RFC 3986</xref>) is identical
433+
to the primary resource. This can occur with the empty fragment,
434+
or when one schema resource is embedded in another. Any such URIs
435+
with fragments are considered to be non-canonical.
432436
</t>
433437
<t>
434438
The root schema is the schema that comprises the entire JSON document
435439
in question. The root schema is always a schema resource, where the
436440
URI is determined as described in section
437441
<xref target="initial-base" format="counter"></xref>.
442+
<cref>
443+
Note that documents that embed schemas in another format will not
444+
have a root schema resource in this sense. Exactly how such usages
445+
fit with the JSON Schema document and resource concepts will be
446+
clarified in a future draft.
447+
</cref>
438448
</t>
439449
<t>
440450
Some keywords take schemas themselves, allowing JSON Schemas to be nested:
@@ -1342,17 +1352,19 @@
13421352
<t>
13431353
If present, the value for this keyword MUST be a string, and MUST represent a
13441354
valid <xref target="RFC3986">URI-reference</xref>. This URI-reference
1345-
SHOULD be normalized, and MUST be semantically equivalent to an
1346-
<xref target="RFC3986">absolute-URI</xref> (without a fragment).
1355+
SHOULD be normalized, and MUST resolve to an
1356+
<xref target="RFC3986">absolute-URI</xref> (without a fragment),
1357+
or to a URI with an empty fragment.
13471358
</t>
13481359
<t>
1349-
The application/schema+json media type defines that an absolute-URI
1350-
identifying a resource and the same URI with an empty fragment
1351-
appended (which identifies the resource's root schema object) are
1352-
semantically equivalent. Since this semantic equivalence is not part
1353-
of the <xref target="RFC3986">RFC 3986 normalization process</xref>,
1354-
implementors and schema authors cannot rely on generic URI libraries
1355-
understanding the equivalence.
1360+
The empty fragment form is NOT RECOMMENDED and is retained only
1361+
for backwards compatibility, and because the
1362+
application/schema+json media type defines that a URI with an
1363+
empty fragment identifies the same resource as the same URI
1364+
with the fragment removed. However, since this equivalence is not
1365+
part of the <xref target="RFC3986">RFC 3986 normalization process</xref>,
1366+
implementers and schema authors cannot rely on generic URI libraries
1367+
understanding it.
13561368
</t>
13571369
<t>
13581370
Therefore, "$id" MUST NOT contain a non-empty fragment, and SHOULD NOT
@@ -1757,7 +1769,7 @@
17571769
Since JSON Pointer URI fragments are constructed based on the structure
17581770
of the schema document, an embedded schema resource and its subschemas
17591771
can be identified by JSON Pointer fragments relative to either its own
1760-
canonical URI, or relative to a containing resource's URI.
1772+
canonical URI, or relative to any containing resource's URI.
17611773
</t>
17621774
<t>
17631775
Conceptually, a set of linked schema resources should behave
@@ -1822,10 +1834,12 @@
18221834
]]>
18231835
</artwork>
18241836
<postamble>
1825-
Here we see that the URI for the "additionalProperties" schema object
1826-
that is relative to its resource's canonical URI is still valid,
1827-
while the URI relative to the "items" schema object's URI no longer
1828-
resolves to anything.
1837+
Here we see that "https://example.com/bar#/additionalProperties",
1838+
using a JSON Pointer fragment appended to the canonical URI of
1839+
the "bar" schema resource, is still valid, while
1840+
"https://example.com/foo#/items/additionalProperties", which relied
1841+
on a JSON Pointer fragment appended to the canonical URI of the
1842+
"foo" schema resource, no longer resolves to anything.
18291843
</postamble>
18301844
</figure>
18311845
<t>

0 commit comments

Comments
 (0)