Skip to content

Commit 9a14b73

Browse files
committed
Update based on review feedback.
1 parent fee0296 commit 9a14b73

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

Diff for: jsonschema-core.xml

+30-16
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,24 @@
420420
A JSON Schema resource is a schema which is
421421
<xref target="RFC6596">canonically</xref> identified by an
422422
<xref target="RFC3986">absolute URI</xref>. Schema resources MAY
423-
also be identified by URIs including fragments. Any such URIs
424-
are considered to be non-canonical.
423+
also be identified by URIs, including URIs with fragments,
424+
if the resulting secondary resource (as defined by
425+
<xref target="RFC3986">section 3.5 of RFC 3986</xref>) is identical
426+
to the primary resource. This can occur with the empty fragment,
427+
or when one schema resource is embedded in another. Any such URIs
428+
with fragments are considered to be non-canonical.
425429
</t>
426430
<t>
427431
The root schema is the schema that comprises the entire JSON document
428432
in question. The root schema is always a schema resource, where the
429433
URI is determined as described in section
430434
<xref target="initial-base" format="counter"></xref>.
435+
<cref>
436+
Note that documents that embed schemas in another format will not
437+
have a root schema resource in this sense. Exactly how such usages
438+
fit with the JSON Schema document and resource concepts will be
439+
clarified in a future draft.
440+
</cref>
431441
</t>
432442
<t>
433443
Some keywords take schemas themselves, allowing JSON Schemas to be nested:
@@ -1335,17 +1345,19 @@
13351345
<t>
13361346
If present, the value for this keyword MUST be a string, and MUST represent a
13371347
valid <xref target="RFC3986">URI-reference</xref>. This URI-reference
1338-
SHOULD be normalized, and MUST be semantically equivalent to an
1339-
<xref target="RFC3986">absolute-URI</xref> (without a fragment).
1348+
SHOULD be normalized, and MUST resolve to an
1349+
<xref target="RFC3986">absolute-URI</xref> (without a fragment),
1350+
or to a URI with an empty fragment.
13401351
</t>
13411352
<t>
1342-
The application/schema+json media type defines that an absolute-URI
1343-
identifying a resource and the same URI with an empty fragment
1344-
appended (which identifies the resource's root schema object) are
1345-
semantically equivalent. Since this semantic equivalence is not part
1346-
of the <xref target="RFC3986">RFC 3986 normalization process</xref>,
1347-
implementors and schema authors cannot rely on generic URI libraries
1348-
understanding the equivalence.
1353+
The empty fragment form is NOT RECOMMENDED and is retained only
1354+
for backwards compatibility, and because the
1355+
application/schema+json media type defines that a URI with an
1356+
empty fragment identifies the same resource as the same URI
1357+
with the fragment removed. However, since this equivalence is not
1358+
part of the <xref target="RFC3986">RFC 3986 normalization process</xref>,
1359+
implementers and schema authors cannot rely on generic URI libraries
1360+
understanding it.
13491361
</t>
13501362
<t>
13511363
Therefore, "$id" MUST NOT contain a non-empty fragment, and SHOULD NOT
@@ -1750,7 +1762,7 @@
17501762
Since JSON Pointer URI fragments are constructed based on the structure
17511763
of the schema document, an embedded schema resource and its subschemas
17521764
can be identified by JSON Pointer fragments relative to either its own
1753-
canonical URI, or relative to a containing resource's URI.
1765+
canonical URI, or relative to any containing resource's URI.
17541766
</t>
17551767
<t>
17561768
Conceptually, a set of linked schema resources should behave
@@ -1815,10 +1827,12 @@
18151827
]]>
18161828
</artwork>
18171829
<postamble>
1818-
Here we see that the URI for the "additionalProperties" schema object
1819-
that is relative to its resource's canonical URI is still valid,
1820-
while the URI relative to the "items" schema object's URI no longer
1821-
resolves to anything.
1830+
Here we see that "https://example.com/bar#/additionalProperties",
1831+
using a JSON Pointer fragment appended to the canonical URI of
1832+
the "bar" schema resource, is still valid, while
1833+
"https://example.com/foo#/items/additionalProperties", which relied
1834+
on a JSON Pointer fragment appended to the canonical URI of the
1835+
"foo" schema resource, no longer resolves to anything.
18221836
</postamble>
18231837
</figure>
18241838
<t>

0 commit comments

Comments
 (0)