Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 685d84e

Browse files
authoredNov 5, 2021
Support for IRI references (#1137)
* Change URIs to IRIs where appropriate
1 parent 13a58c7 commit 685d84e

File tree

2 files changed

+173
-164
lines changed

2 files changed

+173
-164
lines changed
 

‎jsonschema-core.xml

Lines changed: 164 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
33
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
44
<!ENTITY RFC3986 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">
5+
<!ENTITY RFC3987 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3987.xml">
56
<!ENTITY RFC6596 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6596.xml">
67
<!ENTITY RFC6839 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6839.xml">
78
<!ENTITY RFC6901 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6901.xml">
@@ -205,7 +206,7 @@
205206
</t>
206207
<t>
207208
Among these, this specification defines the "application/schema-instance+json"
208-
media type which defines handling for fragments in the URI.
209+
media type which defines handling for fragments in the IRI.
209210
</t>
210211

211212
<section title="Instance Data Model">
@@ -316,7 +317,7 @@
316317
<list style="hanging">
317318
<t hangText="identifiers:">
318319
control schema identification through setting the schema's
319-
canonical URI and/or changing how the base URI is determined
320+
canonical IRI and/or changing how the base IRI is determined
320321
</t>
321322
<t hangText="assertions:">
322323
produce a boolean result when applied to an instance
@@ -393,7 +394,7 @@
393394
<t>
394395
Vocabularies are the primary unit of re-use in JSON Schema, as schema
395396
authors can indicate what vocabularies are required or optional in
396-
order to process the schema. Since vocabularies are identified by URIs
397+
order to process the schema. Since vocabularies are identified by IRIs
397398
in the meta-schema, generic implementations can load extensions to support
398399
previously unknown vocabularies. While keywords can be supported outside
399400
of any vocabulary, there is no analogous mechanism to indicate individual
@@ -419,12 +420,12 @@
419420
<t>
420421
A JSON Schema resource is a schema which is
421422
<xref target="RFC6596">canonically</xref> identified by an
422-
<xref target="RFC3986">absolute URI</xref>.
423+
<xref target="RFC3987">absolute IRI</xref>.
423424
</t>
424425
<t>
425426
The root schema is the schema that comprises the entire JSON document
426427
in question. The root schema is always a schema resource, where the
427-
URI is determined as described in section
428+
IRI is determined as described in section
428429
<xref target="initial-base" format="counter"></xref>.
429430
</t>
430431
<t>
@@ -482,7 +483,7 @@
482483
fragment identifier structure: JSON Pointers.
483484
</t>
484485
<t>
485-
The use of JSON Pointers as URI fragment identifiers is described in
486+
The use of JSON Pointers as IRI fragment identifiers is described in
486487
<xref target="RFC6901">RFC 6901</xref>.
487488
For "application/schema+json", which supports two fragment identifier syntaxes,
488489
fragment identifiers matching the JSON Pointer syntax, including the empty string,
@@ -638,9 +639,9 @@
638639
schema object with no subschemas.
639640
</t>
640641
<t>
641-
Keywords MAY be defined with a partial value, such as a URI-reference,
642+
Keywords MAY be defined with a partial value, such as a IRI-reference,
642643
which must be resolved against another value, such as another
643-
URI-reference or a full URI, which is found through the lexical
644+
IRI-reference or a full IRI, which is found through the lexical
644645
structure of the JSON document. The "$id", "$ref", and
645646
"$dynamicRef" core keywords, and the "base" JSON Hyper-Schema
646647
keyword, are examples of this sort of behavior.
@@ -725,20 +726,20 @@
725726
</section>
726727
<section title="Identifiers" anchor="identifiers">
727728
<t>
728-
Identifiers set the canonical URI of a schema, or affect how such URIs are
729+
Identifiers set the canonical IRI of a schema, or affect how such IRIs are
729730
resolved in <xref target="references">references</xref>, or both.
730731
The Core vocabulary defined in this document defines several
731732
identifying keywords, most notably "$id".
732733
</t>
733734
<t>
734-
Canonical schema URIs MUST NOT change while processing an instance, but
735-
keywords that affect URI-reference resolution MAY have behavior that
735+
Canonical schema IRIs MUST NOT change while processing an instance, but
736+
keywords that affect IRI-reference resolution MAY have behavior that
736737
is only fully determined at runtime.
737738
</t>
738739
<t>
739740
While custom identifier keywords are possible, vocabulary designers should
740741
take care not to disrupt the functioning of core keywords. For example,
741-
the "$dynamicAnchor" keyword in this specification limits its URI resolution
742+
the "$dynamicAnchor" keyword in this specification limits its IRI resolution
742743
effects to the matching "$dynamicRef" keyword, leaving the behavior
743744
of "$ref" undisturbed.
744745
</t>
@@ -913,7 +914,7 @@
913914
such as "$ref" were followed to reach the absolute schema location.
914915
</t>
915916
<t>
916-
The absolute schema location of the attaching keyword, as a URI.
917+
The absolute schema location of the attaching keyword, as a IRI.
917918
This MAY be omitted if it is the same as the schema location path
918919
from above.
919920
</t>
@@ -1117,14 +1118,14 @@
11171118
</t>
11181119
<t>
11191120
Meta-schemas that do not use "$vocabulary" MUST be considered to
1120-
require the Core vocabulary as if its URI were present with a value of true.
1121+
require the Core vocabulary as if its IRI were present with a value of true.
11211122
</t>
11221123
<t>
1123-
The current URI for the Core vocabulary is:
1124+
The current IRI for the Core vocabulary is:
11241125
&lt;https://json-schema.org/draft/2020-12/vocab/core&gt;.
11251126
</t>
11261127
<t>
1127-
The current URI for the corresponding meta-schema is:
1128+
The current IRI for the corresponding meta-schema is:
11281129
<eref target="https://json-schema.org/draft/2020-12/meta/core"/>.
11291130
</t>
11301131
<t>
@@ -1176,12 +1177,12 @@
11761177
set of valid schemas written for this particular dialect.
11771178
</t>
11781179
<t>
1179-
The value of this keyword MUST be a <xref target="RFC3986">URI</xref>
1180-
(containing a scheme) and this URI MUST be normalized.
1181-
The current schema MUST be valid against the meta-schema identified by this URI.
1180+
The value of this keyword MUST be a <xref target="RFC3987">IRI</xref>
1181+
(containing a scheme) and this IRI MUST be normalized.
1182+
The current schema MUST be valid against the meta-schema identified by this IRI.
11821183
</t>
11831184
<t>
1184-
If this URI identifies a retrievable resource, that resource SHOULD be of
1185+
If this IRI identifies a retrievable resource, that resource SHOULD be of
11851186
media type "application/schema+json".
11861187
</t>
11871188
<t>
@@ -1208,15 +1209,15 @@
12081209
</t>
12091210
<t>
12101211
The value of this keyword MUST be an object. The property names in the
1211-
object MUST be URIs (containing a scheme) and this URI MUST be normalized.
1212-
Each URI that appears as a property name identifies a specific set of
1212+
object MUST be IRIs (containing a scheme) and this IRI MUST be normalized.
1213+
Each IRI that appears as a property name identifies a specific set of
12131214
keywords and their semantics.
12141215
</t>
12151216
<t>
1216-
The URI MAY be a URL, but the nature of the retrievable resource is
1217+
The IRI MAY be a URL, but the nature of the retrievable resource is
12171218
currently undefined, and reserved for future use. Vocabulary authors
12181219
MAY use the URL of the vocabulary specification, in a human-readable
1219-
media type such as text/html or text/plain, as the vocabulary URI.
1220+
media type such as text/html or text/plain, as the vocabulary IRI.
12201221
<cref>
12211222
Vocabulary documents may be added in forthcoming drafts.
12221223
For now, identifying the keyword set is deemed sufficient as that,
@@ -1257,7 +1258,7 @@
12571258
<t>
12581259
If "$vocabulary" is absent, an implementation MAY determine
12591260
behavior based on the meta-schema if it is recognized from the
1260-
URI value of the referring schema's "$schema" keyword.
1261+
IRI value of the referring schema's "$schema" keyword.
12611262
This is how behavior (such as Hyper-Schema usage) has been
12621263
recognized prior to the existence of vocabularies.
12631264
</t>
@@ -1297,51 +1298,51 @@
12971298
</t>
12981299
</section>
12991300
</section>
1300-
<section title="Updates to Meta-Schema and Vocabulary URIs">
1301+
<section title="Updates to Meta-Schema and Vocabulary IRIs">
13011302
<t>
1302-
Updated vocabulary and meta-schema URIs MAY be published between
1303+
Updated vocabulary and meta-schema IRIs MAY be published between
13031304
specification drafts in order to correct errors. Implementations
1304-
SHOULD consider URIs dated after this specification draft and
1305+
SHOULD consider IRIs dated after this specification draft and
13051306
before the next to indicate the same syntax and semantics
13061307
as those listed here.
13071308
</t>
13081309
</section>
13091310
</section>
13101311

1311-
<section title="Base URI, Anchors, and Dereferencing">
1312+
<section title="Base IRI, Anchors, and Dereferencing">
13121313
<t>
13131314
To differentiate between schemas in a vast ecosystem, schemas are
1314-
identified by <xref target="RFC3986">URI</xref>, and can embed references
1315-
to other schemas by specifying their URI.
1315+
identified by <xref target="RFC3987">IRI</xref>, and can embed references
1316+
to other schemas by specifying their IRI.
13161317
</t>
13171318
<t>
1318-
Several keywords can accept a relative <xref target="RFC3986">URI-reference</xref>,
1319-
or a value used to construct a relative URI-reference. For these keywords,
1320-
it is necessary to establish a base URI in order to resolve the reference.
1319+
Several keywords can accept a relative <xref target="RFC3987">IRI-reference</xref>,
1320+
or a value used to construct a relative IRI-reference. For these keywords,
1321+
it is necessary to establish a base IRI in order to resolve the reference.
13211322
</t>
13221323

13231324
<section title='The "$id" Keyword' anchor="id-keyword">
13241325
<t>
13251326
The "$id" keyword identifies a schema resource with its
1326-
<xref target="RFC6596">canonical</xref> URI.
1327+
<xref target="RFC6596">canonical</xref> IRI.
13271328
</t>
13281329
<t>
1329-
Note that this URI is an identifier and not necessarily a network locator.
1330+
Note that this IRI is an identifier and not necessarily a network locator.
13301331
In the case of a network-addressable URL, a schema need not be downloadable
1331-
from its canonical URI.
1332+
from its canonical IRI.
13321333
</t>
13331334
<t>
13341335
If present, the value for this keyword MUST be a string, and MUST represent a
1335-
valid <xref target="RFC3986">URI-reference</xref>. This URI-reference
1336+
valid <xref target="RFC3987">IRI-reference</xref>. This IRI-reference
13361337
SHOULD be normalized, and MUST resolve to an
1337-
<xref target="RFC3986">absolute-URI</xref> (without a fragment). Therefore,
1338+
<xref target="RFC3987">absolute-IRI</xref> (without a fragment). Therefore,
13381339
"$id" MUST NOT contain a non-empty fragment, and SHOULD NOT contain an
13391340
empty fragment.
13401341
</t>
13411342
<t>
13421343
Since an empty fragment in the context of the application/schema+json media
1343-
type refers to the same resource as the base URI without a fragment,
1344-
an implementation MAY normalize a URI ending with an empty fragment by removing
1344+
type refers to the same resource as the base IRI without a fragment,
1345+
an implementation MAY normalize a IRI ending with an empty fragment by removing
13451346
the fragment. However, schema authors SHOULD NOT rely on this behavior
13461347
across implementations.
13471348
<cref>
@@ -1351,28 +1352,30 @@
13511352
</cref>
13521353
</t>
13531354
<t>
1354-
This URI also serves as the base URI for relative URI-references in keywords
1355+
This IRI also serves as the base IRI for relative IRI-references in keywords
13551356
within the schema resource, in accordance with
1357+
<xref target="RFC3987">RFC 3987 section 6.5</xref> and
13561358
<xref target="RFC3986">RFC 3986 section 5.1.1</xref> regarding base URIs
13571359
embedded in content.
13581360
</t>
13591361
<t>
13601362
The presence of "$id" in a subschema indicates that the subschema constitutes
13611363
a distinct schema resource within a single schema document. Furthermore,
1362-
in accordance with <xref target="RFC3986">RFC 3986 section 5.1.2</xref>
1363-
regarding encapsulating entities, if an "$id" in a subschema is a relative
1364-
URI-reference, the base URI for resolving that reference is the URI of
1364+
in accordance with <xref target="RFC3987">RFC 3987 section 6.5</xref> and
1365+
<xref target="RFC3986">RFC 3986 section 5.1.2</xref> regarding
1366+
encapsulating entities, if an "$id" in a subschema is a relative
1367+
IRI-reference, the base IRI for resolving that reference is the IRI of
13651368
the parent schema resource.
13661369
</t>
13671370
<t>
13681371
If no parent schema object explicitly identifies itself as a resource
1369-
with "$id", the base URI is that of the entire document, as established
1372+
with "$id", the base IRI is that of the entire document, as established
13701373
by the steps given in the <xref target="initial-base">previous section.</xref>
13711374
</t>
13721375
<section title="Identifying the root schema">
13731376
<t>
13741377
The root schema of a JSON Schema document SHOULD contain an "$id" keyword
1375-
with an <xref target="RFC3986">absolute-URI</xref> (containing a scheme,
1378+
with an <xref target="RFC3987">absolute-IRI</xref> (containing a scheme,
13761379
but no fragment).
13771380
</t>
13781381
</section>
@@ -1388,17 +1391,19 @@
13881391
<t>
13891392
The "$anchor" and "$dynamicAnchor" keywords are used to specify such
13901393
fragments. They are identifier keywords that can only be used to create
1391-
plain name fragments, rather than absolute URIs as seen with "$id".
1394+
plain name fragments, rather than absolute IRIs as seen with "$id".
13921395
</t>
13931396
<t>
1394-
The base URI to which the resulting fragment is appended is the canonical
1395-
URI of the schema resource containing the "$anchor" or "$dynamicAnchor"
1397+
The base IRI to which the resulting fragment is appended is the canonical
1398+
IRI of the schema resource containing the "$anchor" or "$dynamicAnchor"
13961399
in question. As discussed in the previous section, this is either the
1397-
nearest "$id" in the same or parent schema object, or the base URI
1398-
for the document as determined according to RFC 3986.
1400+
nearest "$id" in the same or parent schema object,
1401+
or the base IRI for the document as determined according to
1402+
<xref target="RFC3987">RFC 3987</xref> and
1403+
<xref target="RFC3986">RFC 3986</xref>.
13991404
</t>
14001405
<t>
1401-
Separately from the usual usage of URIs, "$dynamicAnchor"
1406+
Separately from the usual usage of IRIs, "$dynamicAnchor"
14021407
indicates that the fragment is an extension point when used with
14031408
the "$dynamicRef" keyword. This low-level, advanced feature
14041409
makes it easier to extend recursive schemas such as the meta-schemas,
@@ -1420,8 +1425,8 @@
14201425
<xref target="xml-names">NCName production</xref>.
14211426
<cref>
14221427
Note that the anchor string does not include the "#" character,
1423-
as it is not a URI-reference. An "$anchor": "foo" becomes the
1424-
fragment "#foo" when used in a URI. See below for full examples.
1428+
as it is not a IRI-reference. An "$anchor": "foo" becomes the
1429+
fragment "#foo" when used in a IRI. See below for full examples.
14251430
</cref>
14261431
</t>
14271432
<t>
@@ -1439,17 +1444,17 @@
14391444
keywords, applying the referenced schema to the instance.
14401445
</t>
14411446
<t>
1442-
As the values of "$ref" and "$dynamicRef" are URI References, this allows
1447+
As the values of "$ref" and "$dynamicRef" are IRI References, this allows
14431448
the possibility to externalise or divide a schema across multiple files,
14441449
and provides the ability to validate recursive structures through
14451450
self-reference.
14461451
</t>
14471452
<t>
1448-
The resolved URI produced by these keywords is not necessarily a network
1453+
The resolved IRI produced by these keywords is not necessarily a network
14491454
locator, only an identifier. A schema need not be downloadable from the
14501455
address if it is a network-addressable URL, and implementations SHOULD NOT
14511456
assume they should perform a network operation when they encounter
1452-
a network-addressable URI.
1457+
a network-addressable IRI.
14531458
</t>
14541459

14551460
<section title='Direct References with "$ref"' anchor="ref">
@@ -1462,8 +1467,8 @@
14621467
</cref>
14631468
</t>
14641469
<t>
1465-
The value of the "$ref" keyword MUST be a string which is a URI-Reference.
1466-
Resolved against the current URI base, it produces the URI of the schema
1470+
The value of the "$ref" keyword MUST be a string which is a IRI-Reference.
1471+
Resolved against the current IRI base, it produces the IRI of the schema
14671472
to apply. This resolution is safe to perform on schema load, as the
14681473
process of evaluating an instance cannot change how the reference resolves.
14691474
</t>
@@ -1485,14 +1490,14 @@
14851490
</t>
14861491
<t>
14871492
The value of the "$dynamicRef" property MUST be a string which is
1488-
a URI-Reference. Resolved against the current URI base, it produces
1489-
the URI used as the starting point for runtime resolution. This initial
1493+
a IRI-Reference. Resolved against the current IRI base, it produces
1494+
the IRI used as the starting point for runtime resolution. This initial
14901495
resolution is safe to perform on schema load.
14911496
</t>
14921497
<t>
1493-
If the initially resolved starting point URI includes a fragment that
1494-
was created by the "$dynamicAnchor" keyword, the initial URI MUST be
1495-
replaced by the URI (including the fragment) for the outermost schema
1498+
If the initially resolved starting point IRI includes a fragment that
1499+
was created by the "$dynamicAnchor" keyword, the initial IRI MUST be
1500+
replaced by the IRI (including the fragment) for the outermost schema
14961501
resource in the <xref target="scopes">dynamic scope</xref> that defines
14971502
an identically named fragment with "$dynamicAnchor".
14981503
</t>
@@ -1589,62 +1594,65 @@
15891594
<t>
15901595
</t>
15911596
<section title="Loading a Schema">
1592-
<section title="Initial Base URI" anchor="initial-base">
1597+
<section title="Initial Base IRI" anchor="initial-base">
15931598
<t>
1594-
<xref target="RFC3986">RFC3986 Section 5.1</xref> defines how to determine the
1595-
default base URI of a document.
1599+
<xref target="RFC3987">RFC 3987 Section 6.5</xref> and
1600+
<xref target="RFC3986">RFC 3986 Section 5.1</xref> defines how to determine the
1601+
default base IRI of a document.
15961602
</t>
15971603
<t>
1598-
Informatively, the initial base URI of a schema is the URI at which it was
1604+
Informatively, the initial base IRI of a schema is the IRI at which it was
15991605
found, whether that was a network location, a local filesystem, or any other
1600-
situation identifiable by a URI of any known scheme.
1606+
situation identifiable by a IRI of any known scheme.
16011607
</t>
16021608
<t>
1603-
If a schema document defines no explicit base URI with "$id"
1604-
(embedded in content), the base URI is that determined per
1609+
If a schema document defines no explicit base IRI with "$id"
1610+
(embedded in content), the base IRI is that determined per
1611+
<xref target="RFC3987">RFC 3987 Section 6.5</xref> and
16051612
<xref target="RFC3986">RFC 3986 section 5</xref>.
16061613
</t>
16071614
<t>
1608-
If no source is known, or no URI scheme is known for the source, a suitable
1609-
implementation-specific default URI MAY be used as described in
1610-
<xref target="RFC3986"> RFC 3986 Section 5.1.4</xref>. It is RECOMMENDED
1611-
that implementations document any default base URI that they assume.
1615+
If no source is known, or no IRI scheme is known for the source, a suitable
1616+
implementation-specific default IRI MAY be used as described in
1617+
<xref target="RFC3987">RFC 3987 Section 6.5</xref> and
1618+
<xref target="RFC3986">RFC 3986 Section 5.1.4</xref>. It is RECOMMENDED
1619+
that implementations document any default base IRI that they assume.
16121620
</t>
16131621
<t>
16141622
If a schema object is embedded in a document of another media type, then
1615-
the initial base URI is determined according to the rules of that
1623+
the initial base IRI is determined according to the rules of that
16161624
media type.
16171625
</t>
16181626
<t>
16191627
Unless the "$id" keyword described in the next section is present in the
1620-
root schema, this base URI SHOULD be considered the canonical URI of the
1628+
root schema, this base IRI SHOULD be considered the canonical IRI of the
16211629
schema document's root schema resource.
16221630
</t>
16231631
</section>
16241632

16251633
<section title="Loading a referenced schema">
16261634
<t>
1627-
The use of URIs to identify remote schemas does not necessarily mean anything is downloaded,
1635+
The use of IRIs to identify remote schemas does not necessarily mean anything is downloaded,
16281636
but instead JSON Schema implementations SHOULD understand ahead of time which schemas they will be using,
1629-
and the URIs that identify them.
1637+
and the IRIs that identify them.
16301638
</t>
16311639
<t>
16321640
When schemas are downloaded,
16331641
for example by a generic user-agent that does not know until runtime which schemas to download,
16341642
see <xref target="hypermedia">Usage for Hypermedia</xref>.
16351643
</t>
16361644
<t>
1637-
Implementations SHOULD be able to associate arbitrary URIs with an arbitrary
1638-
schema and/or automatically associate a schema's "$id"-given URI, depending
1639-
on the trust that the validator has in the schema. Such URIs and schemas
1645+
Implementations SHOULD be able to associate arbitrary IRIs with an arbitrary
1646+
schema and/or automatically associate a schema's "$id"-given IRI, depending
1647+
on the trust that the validator has in the schema. Such IRIs and schemas
16401648
can be supplied to an implementation prior to processing instances, or may
16411649
be noted within a schema document as it is processed, producing associations
16421650
as shown in appendix <xref target="idExamples" format="counter"></xref>.
16431651
</t>
16441652
<t>
1645-
A schema MAY (and likely will) have multiple URIs, but there is no way for a
1646-
URI to identify more than one schema. When multiple schemas try to identify
1647-
as the same URI, validators SHOULD raise an error condition.
1653+
A schema MAY (and likely will) have multiple IRIs, but there is no way for a
1654+
IRI to identify more than one schema. When multiple schemas try to identify
1655+
as the same IRI, validators SHOULD raise an error condition.
16481656
</t>
16491657
</section>
16501658

@@ -1676,14 +1684,14 @@
16761684

16771685
<section title="Dereferencing">
16781686
<t>
1679-
Schemas can be identified by any URI that has been given to them, including
1680-
a JSON Pointer or their URI given directly by "$id". In all cases,
1687+
Schemas can be identified by any IRI that has been given to them, including
1688+
a JSON Pointer or their IRI given directly by "$id". In all cases,
16811689
dereferencing a "$ref" reference involves first resolving its value as a
1682-
URI reference against the current base URI per
1690+
IRI reference against the current base IRI per
16831691
<xref target="RFC3986">RFC 3986</xref>.
16841692
</t>
16851693
<t>
1686-
If the resulting URI identifies a schema within the current document, or
1694+
If the resulting IRI identifies a schema within the current document, or
16871695
within another schema document that has been made available to the implementation,
16881696
then that schema SHOULD be used automatically.
16891697
</t>
@@ -1714,7 +1722,7 @@
17141722
<t>
17151723
When an implementation encounters the &lt;#/$defs/single&gt; schema,
17161724
it resolves the "$anchor" value as a fragment name against the current
1717-
base URI to form &lt;https://example.net/root.json#item&gt;.
1725+
base IRI to form &lt;https://example.net/root.json#item&gt;.
17181726
</t>
17191727
<t>
17201728
When an implementation then looks inside the &lt;#/items&gt; schema, it
@@ -1740,10 +1748,10 @@
17401748
<section title="JSON Pointer fragments and embedded schema resources"
17411749
anchor="embedded">
17421750
<t>
1743-
Since JSON Pointer URI fragments are constructed based on the structure
1751+
Since JSON Pointer IRI fragments are constructed based on the structure
17441752
of the schema document, an embedded schema resource and its subschemas
17451753
can be identified by JSON Pointer fragments relative to either its own
1746-
canonical URI, or relative to the containing resource's URI.
1754+
canonical IRI, or relative to the containing resource's IRI.
17471755
</t>
17481756
<t>
17491757
Conceptually, a set of linked schema resources should behave
@@ -1753,10 +1761,10 @@
17531761
subschemas.
17541762
</t>
17551763
<t>
1756-
Since URIs involving JSON Pointer fragments relative to the parent
1757-
schema resource's URI cease to be valid when the embedded schema
1764+
Since IRIs involving JSON Pointer fragments relative to the parent
1765+
schema resource's IRI cease to be valid when the embedded schema
17581766
is moved to a separate document and referenced, applications and schemas
1759-
SHOULD NOT use such URIs to identify embedded schema resources or
1767+
SHOULD NOT use such IRIs to identify embedded schema resources or
17601768
locations within them.
17611769
</t>
17621770
<figure>
@@ -1776,16 +1784,16 @@
17761784
]]>
17771785
</artwork>
17781786
<postamble>
1779-
The URI "https://example.com/foo#/items/additionalProperties"
1787+
The IRI "https://example.com/foo#/items/additionalProperties"
17801788
points to the schema of the "additionalProperties" keyword in
1781-
the embedded resource. The canonical URI of that schema, however,
1789+
the embedded resource. The canonical IRI of that schema, however,
17821790
is "https://example.com/bar#/additionalProperties".
17831791
</postamble>
17841792
</figure>
17851793
<figure>
17861794
<preamble>
17871795
Now consider the following two schema resources linked by reference
1788-
using a URI value for "$ref":
1796+
using a IRI value for "$ref":
17891797
</preamble>
17901798
<artwork>
17911799
<![CDATA[
@@ -1803,27 +1811,27 @@
18031811
]]>
18041812
</artwork>
18051813
<postamble>
1806-
Here we see that the canonical URI for that "additionalProperties"
1807-
subschema is still valid, while the non-canonical URI with the fragment
1814+
Here we see that the canonical IRI for that "additionalProperties"
1815+
subschema is still valid, while the non-canonical IRI with the fragment
18081816
beginning with "#/items/$ref" now resolves to nothing.
18091817
</postamble>
18101818
</figure>
18111819
<t>
18121820
Note also that "https://example.com/foo#/items" is valid in both
1813-
arrangements, but resolves to a different value. This URI ends up
1814-
functioning similarly to a retrieval URI for a resource. While valid,
1821+
arrangements, but resolves to a different value. This IRI ends up
1822+
functioning similarly to a retrieval IRI for a resource. While valid,
18151823
examining the resolved value and either using the "$id" (if the value
18161824
is a subschema), or resolving the reference and using the "$id" of the
18171825
reference target, is preferable.
18181826
</t>
18191827
<t>
18201828
An implementation MAY choose not to support addressing schemas
1821-
by non-canonical URIs. As such, it is RECOMMENDED that schema authors only
1822-
use canonical URIs, as using non-canonical URIs may reduce
1829+
by non-canonical IRIs. As such, it is RECOMMENDED that schema authors only
1830+
use canonical IRIs, as using non-canonical IRIs may reduce
18231831
schema interoperability.
18241832
<cref>
18251833
This is to avoid requiring implementations to keep track of a whole
1826-
stack of possible base URIs and JSON Pointer fragments for each,
1834+
stack of possible base IRIs and JSON Pointer fragments for each,
18271835
given that all but one will be fragile if the schema resources
18281836
are reorganized. Some have argued that this is easy so there is
18291837
no point in forbidding it, while others have argued that it complicates
@@ -1832,8 +1840,8 @@
18321840
</cref>
18331841
</t>
18341842
<t>
1835-
Further examples of such non-canonical URIs, as well as the appropriate
1836-
canonical URIs to use instead, are provided in appendix
1843+
Further examples of such non-canonical IRIs, as well as the appropriate
1844+
canonical IRIs to use instead, are provided in appendix
18371845
<xref target="idExamples" format="counter"></xref>.
18381846
</t>
18391847
</section>
@@ -1854,13 +1862,13 @@
18541862
The bundling process for creating a Compound Schema Document is defined as taking
18551863
references (such as "$ref") to an external Schema Resource and embedding the referenced
18561864
Schema Resources within the referring document. Bundling SHOULD be done in such a way that
1857-
all URIs (used for referencing) in the base document and any referenced/embedded
1865+
all IRIs (used for referencing) in the base document and any referenced/embedded
18581866
documents do not require altering.
18591867
</t>
18601868
<t>
1861-
Each embedded JSON Schema Resource MUST identify itself with a URI using the "$id" keyword,
1869+
Each embedded JSON Schema Resource MUST identify itself with a IRI using the "$id" keyword,
18621870
and SHOULD make use of the "$schema" keyword to identify the dialect it is using, in the root of the
1863-
schema resource. It is RECOMMENDED that the URI identifier value of "$id" be an Absolute URI.
1871+
schema resource. It is RECOMMENDED that the IRI identifier value of "$id" be an Absolute IRI.
18641872
</t>
18651873
<t>
18661874
When the Schema Resource referenced by a by-reference applicator is bundled, it is RECOMMENDED that
@@ -1881,7 +1889,7 @@
18811889
<t>
18821890
In order to produce identical output, references in the containing schema document to the
18831891
previously external Schema Resources MUST NOT be changed, and now resolve to a schema using the
1884-
"$id" of an embedded Schema Resource. Such identical output includes validation evaluation and URIs
1892+
"$id" of an embedded Schema Resource. Such identical output includes validation evaluation and IRIs
18851893
or paths used in resulting annotations or errors.
18861894
</t>
18871895
<t>
@@ -2051,20 +2059,20 @@
20512059
</t>
20522060
<t>
20532061
Meta-schemas that do not use "$vocabulary" SHOULD be considered to
2054-
require this vocabulary as if its URI were present with a value of true.
2062+
require this vocabulary as if its IRI were present with a value of true.
20552063
</t>
20562064
<t>
2057-
The current URI for this vocabulary, known as the Applicator vocabulary, is:
2065+
The current IRI for this vocabulary, known as the Applicator vocabulary, is:
20582066
&lt;https://json-schema.org/draft/2020-12/vocab/applicator&gt;.
20592067
</t>
20602068
<t>
2061-
The current URI for the corresponding meta-schema is:
2069+
The current IRI for the corresponding meta-schema is:
20622070
<eref target="https://json-schema.org/draft/2020-12/meta/applicator"/>.
20632071
</t>
20642072
<t>
2065-
Updated vocabulary and meta-schema URIs MAY be published between
2073+
Updated vocabulary and meta-schema IRIs MAY be published between
20662074
specification drafts in order to correct errors. Implementations
2067-
SHOULD consider URIs dated after this specification draft and
2075+
SHOULD consider IRIs dated after this specification draft and
20682076
before the next to indicate the same syntax and semantics
20692077
as those listed here.
20702078
</t>
@@ -2496,10 +2504,10 @@
24962504
</t>
24972505
<t>
24982506
Meta-schemas that do not use "$vocabulary" SHOULD be considered to
2499-
require this vocabulary as if its URI were present with a value of true.
2507+
require this vocabulary as if its IRI were present with a value of true.
25002508
</t>
25012509
<t>
2502-
The current URI for this vocabulary, known as the Unevaluated Applicator
2510+
The current IRI for this vocabulary, known as the Unevaluated Applicator
25032511
vocabulary, is:
25042512
&lt;https://json-schema.org/draft/2020-12/vocab/unevaluated&gt;.
25052513
</t>
@@ -2705,15 +2713,15 @@
27052713
<section title="Keyword Absolute Location">
27062714
<t>
27072715
The absolute, dereferenced location of the validating keyword. The value MUST
2708-
be expressed as a full URI using the canonical URI of the relevant
2716+
be expressed as a full IRI using the canonical IRI of the relevant
27092717
schema object, and it MUST NOT include by-reference applicators
27102718
such as "$ref" or "$dynamicRef" as non-terminal path components.
27112719
It MAY end in such keywords if the error or annotation is for that
27122720
keyword, such as an unresolvable reference.
27132721
<cref>
27142722
Note that "absolute" here is in the sense of "absolute filesystem path"
2715-
(meaning the complete location) rather than the "absolute-URI"
2716-
terminology from RFC 3986 (meaning with scheme but without fragment).
2723+
(meaning the complete location) rather than the "absolute-IRI"
2724+
terminology from RFC 3987 (meaning with scheme but without fragment).
27172725
Keyword absolute locations will have a fragment in order to
27182726
identify the keyword.
27192727
</cref>
@@ -2727,7 +2735,7 @@ https://example.com/schemas/common#/$defs/count/minimum
27272735
</figure>
27282736
<t>
27292737
This information MAY be omitted only if either the dynamic scope did not pass
2730-
over a reference or if the schema does not declare an absolute URI as its "$id".
2738+
over a reference or if the schema does not declare an absolute IRI as its "$id".
27312739
</t>
27322740
<t>
27332741
The JSON key for this information is "absoluteKeywordLocation".
@@ -3014,7 +3022,7 @@ https://example.com/schemas/common#/$defs/count/minimum
30143022
</t>
30153023
<t>
30163024
Because this output structure can be quite large, a smaller example is given
3017-
here for brevity. The URI of the full output structure of the example above is:
3025+
here for brevity. The IRI of the full output structure of the example above is:
30183026
<eref target="https://json-schema.org/draft/2020-12/output/verbose-example"/>.
30193027
</t>
30203028
<figure>
@@ -3076,7 +3084,7 @@ https://example.com/schemas/common#/$defs/count/minimum
30763084
<section title="Output validation schemas">
30773085
<t>
30783086
For convenience, JSON Schema has been provided to validate output generated
3079-
by implementations. Its URI is:
3087+
by implementations. Its IRI is:
30803088
<eref target="https://json-schema.org/draft/2020-12/output/schema"/>.
30813089
</t>
30823090
</section>
@@ -3135,7 +3143,7 @@ https://example.com/schemas/common#/$defs/count/minimum
31353143
Optional parameters:
31363144
<list style="hanging">
31373145
<t hangText="schema:">
3138-
A non-empty list of space-separated URIs, each identifying
3146+
A non-empty list of space-separated IRIs, each identifying
31393147
a JSON Schema resource. The instance SHOULD successfully
31403148
validate against at least one of these meta-schemas.
31413149
Non-validating meta-schemas MAY be included for purposes such
@@ -3179,7 +3187,7 @@ https://example.com/schemas/common#/$defs/count/minimum
31793187
Required parameters:
31803188
<list style="hanging">
31813189
<t hangText="schema:">
3182-
A non-empty list of space-separated URIs, each identifying
3190+
A non-empty list of space-separated IRIs, each identifying
31833191
a JSON Schema resource. The instance SHOULD successfully
31843192
validate against at least one of these schemas.
31853193
Non-validating schemas MAY be included for purposes such
@@ -3219,6 +3227,7 @@ https://example.com/schemas/common#/$defs/count/minimum
32193227
<references title="Normative References">
32203228
&RFC2119;
32213229
&RFC3986;
3230+
&RFC3987;
32223231
&RFC6839;
32233232
&RFC6901;
32243233
&RFC8259;
@@ -3334,84 +3343,84 @@ https://example.com/schemas/common#/$defs/count/minimum
33343343
<t>
33353344
The schemas at the following URI-encoded <xref target="RFC6901">JSON
33363345
Pointers</xref> (relative to the root schema) have the following
3337-
base URIs, and are identifiable by any listed URI in accordance with
3346+
base IRIs, and are identifiable by any listed IRI in accordance with
33383347
sections <xref target="fragments" format="counter"></xref> and
33393348
<xref target="embedded" format="counter"></xref> above.
33403349
</t>
33413350
<t>
33423351
<list style="hanging">
33433352
<t hangText="# (document root)">
33443353
<list style="hanging">
3345-
<t hangText="canonical absolute-URI (and also base URI)">
3354+
<t hangText="canonical absolute-IRI (and also base IRI)">
33463355
https://example.com/root.json
33473356
</t>
3348-
<t hangText="canonical URI with pointer fragment">
3357+
<t hangText="canonical IRI with pointer fragment">
33493358
https://example.com/root.json#
33503359
</t>
33513360
</list>
33523361
</t>
33533362
<t hangText="#/$defs/A">
33543363
<list>
3355-
<t hangText="base URI">https://example.com/root.json</t>
3356-
<t hangText="canonical URI with plain fragment">
3364+
<t hangText="base IRI">https://example.com/root.json</t>
3365+
<t hangText="canonical IRI with plain fragment">
33573366
https://example.com/root.json#foo
33583367
</t>
3359-
<t hangText="canonical URI with pointer fragment">
3368+
<t hangText="canonical IRI with pointer fragment">
33603369
https://example.com/root.json#/$defs/A
33613370
</t>
33623371
</list>
33633372
</t>
33643373
<t hangText="#/$defs/B">
33653374
<list style="hanging">
3366-
<t hangText="base URI">https://example.com/other.json</t>
3367-
<t hangText="canonical URI with pointer fragment">
3375+
<t hangText="base IRI">https://example.com/other.json</t>
3376+
<t hangText="canonical IRI with pointer fragment">
33683377
https://example.com/other.json#
33693378
</t>
3370-
<t hangText="non-canonical URI with fragment relative to root.json">
3379+
<t hangText="non-canonical IRI with fragment relative to root.json">
33713380
https://example.com/root.json#/$defs/B
33723381
</t>
33733382
</list>
33743383
</t>
33753384
<t hangText="#/$defs/B/$defs/X">
33763385
<list style="hanging">
3377-
<t hangText="base URI">https://example.com/other.json</t>
3378-
<t hangText="canonical URI with plain fragment">
3386+
<t hangText="base IRI">https://example.com/other.json</t>
3387+
<t hangText="canonical IRI with plain fragment">
33793388
https://example.com/other.json#bar
33803389
</t>
3381-
<t hangText="canonical URI with pointer fragment">
3390+
<t hangText="canonical IRI with pointer fragment">
33823391
https://example.com/other.json#/$defs/X
33833392
</t>
3384-
<t hangText="non-canonical URI with fragment relative to root.json">
3393+
<t hangText="non-canonical IRI with fragment relative to root.json">
33853394
https://example.com/root.json#/$defs/B/$defs/X
33863395
</t>
33873396
</list>
33883397
</t>
33893398
<t hangText="#/$defs/B/$defs/Y">
33903399
<list style="hanging">
3391-
<t hangText="base URI">https://example.com/t/inner.json</t>
3392-
<t hangText="canonical URI with plain fragment">
3400+
<t hangText="base IRI">https://example.com/t/inner.json</t>
3401+
<t hangText="canonical IRI with plain fragment">
33933402
https://example.com/t/inner.json#bar
33943403
</t>
3395-
<t hangText="canonical URI with pointer fragment">
3404+
<t hangText="canonical IRI with pointer fragment">
33963405
https://example.com/t/inner.json#
33973406
</t>
3398-
<t hangText="non-canonical URI with fragment relative to other.json">
3407+
<t hangText="non-canonical IRI with fragment relative to other.json">
33993408
https://example.com/other.json#/$defs/Y
34003409
</t>
3401-
<t hangText="non-canonical URI with fragment relative to root.json">
3410+
<t hangText="non-canonical IRI with fragment relative to root.json">
34023411
https://example.com/root.json#/$defs/B/$defs/Y
34033412
</t>
34043413
</list>
34053414
</t>
34063415
<t hangText="#/$defs/C">
34073416
<list style="hanging">
3408-
<t hangText="base URI">
3417+
<t hangText="base IRI">
34093418
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f
34103419
</t>
3411-
<t hangText="canonical URI with pointer fragment">
3420+
<t hangText="canonical IRI with pointer fragment">
34123421
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f#
34133422
</t>
3414-
<t hangText="non-canonical URI with fragment relative to root.json">
3423+
<t hangText="non-canonical IRI with fragment relative to root.json">
34153424
https://example.com/root.json#/$defs/C
34163425
</t>
34173426
</list>
@@ -3442,8 +3451,8 @@ https://example.com/schemas/common#/$defs/count/minimum
34423451
</t>
34433452
<t>
34443453
This transformation can be safely and reversibly done as long as
3445-
all static references (e.g. "$ref") use URI-references that resolve
3446-
to canonical URIs, and all schema resources have an absolute-URI
3454+
all static references (e.g. "$ref") use IRI-references that resolve
3455+
to canonical IRIs, and all schema resources have an absolute-IRI
34473456
as the "$id" in their root schema.
34483457
</t>
34493458
<t>
@@ -3452,7 +3461,7 @@ https://example.com/schemas/common#/$defs/count/minimum
34523461
schema objects, and without changing any aspect of validation or
34533462
annotation results. The names of the schemas under "$defs" do
34543463
not affect behavior, assuming they are each unique, as they
3455-
do not appear in canonical URIs for the embedded resources.
3464+
do not appear in canonical IRIs for the embedded resources.
34563465
</t>
34573466
</section>
34583467
<section title="Reference removal is not always safe">
@@ -3521,7 +3530,7 @@ https://example.com/schemas/common#/$defs/count/minimum
35213530
<t>
35223531
When we load these two schemas, we will notice the "$dynamicAnchor"
35233532
named "node" (note the lack of "#" as this is just the name)
3524-
present in each, resulting in the following full schema URIs:
3533+
present in each, resulting in the following full schema IRIs:
35253534
<list style="symbols">
35263535
<t>"https://example.com/tree#node"</t>
35273536
<t>"https://example.com/strict-tree#node"</t>
@@ -3532,9 +3541,9 @@ https://example.com/schemas/common#/$defs/count/minimum
35323541
<t>
35333542
If we apply the "strict-tree" schema to the instance, we will follow
35343543
the "$ref" to the "tree" schema, examine its "children" subschema,
3535-
and find the "$dynamicRef": to "#node" (note the "#" for URI fragment syntax)
3544+
and find the "$dynamicRef": to "#node" (note the "#" for IRI fragment syntax)
35363545
in its "items" subschema. That reference resolves to
3537-
"https://example.com/tree#node", which is a URI with a fragment
3546+
"https://example.com/tree#node", which is a IRI with a fragment
35383547
created by "$dynamicAnchor". Therefore we must examine the dynamic
35393548
scope before following the reference.
35403549
</t>
@@ -3738,7 +3747,7 @@ https://example.com/schemas/common#/$defs/count/minimum
37383747
The standard meta-schemas that combine all vocabularies defined by
37393748
the Core and Validation specification, and that combine all vocabularies
37403749
defined by those specifications as well as the Hyper-Schema specification,
3741-
demonstrate additional complex combinations. These URIs for these
3750+
demonstrate additional complex combinations. These IRIs for these
37423751
meta-schemas may be found in the Validation and Hyper-Schema specifications,
37433752
respectively.
37443753
</t>

‎meta/core.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
"type": ["object", "boolean"],
1111
"properties": {
1212
"$id": {
13-
"$ref": "#/$defs/uriReferenceString",
13+
"$ref": "#/$defs/iriReferenceString",
1414
"$comment": "Non-empty fragments not allowed.",
1515
"pattern": "^[^#]*#?$"
1616
},
17-
"$schema": { "$ref": "#/$defs/uriString" },
18-
"$ref": { "$ref": "#/$defs/uriReferenceString" },
17+
"$schema": { "$ref": "#/$defs/iriString" },
18+
"$ref": { "$ref": "#/$defs/iriReferenceString" },
1919
"$anchor": { "$ref": "#/$defs/anchorString" },
20-
"$dynamicRef": { "$ref": "#/$defs/uriReferenceString" },
20+
"$dynamicRef": { "$ref": "#/$defs/iriReferenceString" },
2121
"$dynamicAnchor": { "$ref": "#/$defs/anchorString" },
2222
"$vocabulary": {
2323
"type": "object",
24-
"propertyNames": { "$ref": "#/$defs/uriString" },
24+
"propertyNames": { "$ref": "#/$defs/iriString" },
2525
"additionalProperties": {
2626
"type": "boolean"
2727
}
@@ -39,13 +39,13 @@
3939
"type": "string",
4040
"pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
4141
},
42-
"uriString": {
42+
"iriString": {
4343
"type": "string",
44-
"format": "uri"
44+
"format": "iri"
4545
},
46-
"uriReferenceString": {
46+
"iriReferenceString": {
4747
"type": "string",
48-
"format": "uri-reference"
48+
"format": "iri-reference"
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)
Please sign in to comment.