2
2
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
3
3
<!ENTITY RFC2119 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml" >
4
4
<!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" >
5
6
<!ENTITY RFC6596 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.6596.xml" >
6
7
<!ENTITY RFC6839 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.6839.xml" >
7
8
<!ENTITY RFC6901 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.6901.xml" >
205
206
</t >
206
207
<t >
207
208
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 .
209
210
</t >
210
211
211
212
<section title =" Instance Data Model" >
316
317
<list style =" hanging" >
317
318
<t hangText =" identifiers:" >
318
319
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
320
321
</t >
321
322
<t hangText =" assertions:" >
322
323
produce a boolean result when applied to an instance
393
394
<t >
394
395
Vocabularies are the primary unit of re-use in JSON Schema, as schema
395
396
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
397
398
in the meta-schema, generic implementations can load extensions to support
398
399
previously unknown vocabularies. While keywords can be supported outside
399
400
of any vocabulary, there is no analogous mechanism to indicate individual
419
420
<t >
420
421
A JSON Schema resource is a schema which is
421
422
<xref target =" RFC6596" >canonically</xref > identified by an
422
- <xref target =" RFC3986 " >absolute URI </xref >.
423
+ <xref target =" RFC3987 " >absolute IRI </xref >.
423
424
</t >
424
425
<t >
425
426
The root schema is the schema that comprises the entire JSON document
426
427
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
428
429
<xref target =" initial-base" format =" counter" ></xref >.
429
430
</t >
430
431
<t >
482
483
fragment identifier structure: JSON Pointers.
483
484
</t >
484
485
<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
486
487
<xref target =" RFC6901" >RFC 6901</xref >.
487
488
For "application/schema+json", which supports two fragment identifier syntaxes,
488
489
fragment identifiers matching the JSON Pointer syntax, including the empty string,
638
639
schema object with no subschemas.
639
640
</t >
640
641
<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,
642
643
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
644
645
structure of the JSON document. The "$id", "$ref", and
645
646
"$dynamicRef" core keywords, and the "base" JSON Hyper-Schema
646
647
keyword, are examples of this sort of behavior.
725
726
</section >
726
727
<section title =" Identifiers" anchor =" identifiers" >
727
728
<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
729
730
resolved in <xref target =" references" >references</xref >, or both.
730
731
The Core vocabulary defined in this document defines several
731
732
identifying keywords, most notably "$id".
732
733
</t >
733
734
<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
736
737
is only fully determined at runtime.
737
738
</t >
738
739
<t >
739
740
While custom identifier keywords are possible, vocabulary designers should
740
741
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
742
743
effects to the matching "$dynamicRef" keyword, leaving the behavior
743
744
of "$ref" undisturbed.
744
745
</t >
913
914
such as "$ref" were followed to reach the absolute schema location.
914
915
</t >
915
916
<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 .
917
918
This MAY be omitted if it is the same as the schema location path
918
919
from above.
919
920
</t >
1117
1118
</t >
1118
1119
<t >
1119
1120
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.
1121
1122
</t >
1122
1123
<t >
1123
- The current URI for the Core vocabulary is:
1124
+ The current IRI for the Core vocabulary is:
1124
1125
< https://json-schema.org/draft/2020-12/vocab/core> .
1125
1126
</t >
1126
1127
<t >
1127
- The current URI for the corresponding meta-schema is:
1128
+ The current IRI for the corresponding meta-schema is:
1128
1129
<eref target =" https://json-schema.org/draft/2020-12/meta/core" />.
1129
1130
</t >
1130
1131
<t >
1176
1177
set of valid schemas written for this particular dialect.
1177
1178
</t >
1178
1179
<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 .
1182
1183
</t >
1183
1184
<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
1185
1186
media type "application/schema+json".
1186
1187
</t >
1187
1188
<t >
1208
1209
</t >
1209
1210
<t >
1210
1211
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
1213
1214
keywords and their semantics.
1214
1215
</t >
1215
1216
<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
1217
1218
currently undefined, and reserved for future use. Vocabulary authors
1218
1219
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 .
1220
1221
<cref >
1221
1222
Vocabulary documents may be added in forthcoming drafts.
1222
1223
For now, identifying the keyword set is deemed sufficient as that,
1257
1258
<t >
1258
1259
If "$vocabulary" is absent, an implementation MAY determine
1259
1260
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.
1261
1262
This is how behavior (such as Hyper-Schema usage) has been
1262
1263
recognized prior to the existence of vocabularies.
1263
1264
</t >
1297
1298
</t >
1298
1299
</section >
1299
1300
</section >
1300
- <section title =" Updates to Meta-Schema and Vocabulary URIs " >
1301
+ <section title =" Updates to Meta-Schema and Vocabulary IRIs " >
1301
1302
<t >
1302
- Updated vocabulary and meta-schema URIs MAY be published between
1303
+ Updated vocabulary and meta-schema IRIs MAY be published between
1303
1304
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
1305
1306
before the next to indicate the same syntax and semantics
1306
1307
as those listed here.
1307
1308
</t >
1308
1309
</section >
1309
1310
</section >
1310
1311
1311
- <section title =" Base URI , Anchors, and Dereferencing" >
1312
+ <section title =" Base IRI , Anchors, and Dereferencing" >
1312
1313
<t >
1313
1314
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 .
1316
1317
</t >
1317
1318
<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.
1321
1322
</t >
1322
1323
1323
1324
<section title =' The "$id" Keyword' anchor =" id-keyword" >
1324
1325
<t >
1325
1326
The "$id" keyword identifies a schema resource with its
1326
- <xref target =" RFC6596" >canonical</xref > URI .
1327
+ <xref target =" RFC6596" >canonical</xref > IRI .
1327
1328
</t >
1328
1329
<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.
1330
1331
In the case of a network-addressable URL, a schema need not be downloadable
1331
- from its canonical URI .
1332
+ from its canonical IRI .
1332
1333
</t >
1333
1334
<t >
1334
1335
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
1336
1337
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,
1338
1339
"$id" MUST NOT contain a non-empty fragment, and SHOULD NOT contain an
1339
1340
empty fragment.
1340
1341
</t >
1341
1342
<t >
1342
1343
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
1345
1346
the fragment. However, schema authors SHOULD NOT rely on this behavior
1346
1347
across implementations.
1347
1348
<cref >
1351
1352
</cref >
1352
1353
</t >
1353
1354
<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
1355
1356
within the schema resource, in accordance with
1357
+ <xref target =" RFC3987" >RFC 3987 section 6.5</xref > and
1356
1358
<xref target =" RFC3986" >RFC 3986 section 5.1.1</xref > regarding base URIs
1357
1359
embedded in content.
1358
1360
</t >
1359
1361
<t >
1360
1362
The presence of "$id" in a subschema indicates that the subschema constitutes
1361
1363
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
1365
1368
the parent schema resource.
1366
1369
</t >
1367
1370
<t >
1368
1371
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
1370
1373
by the steps given in the <xref target =" initial-base" >previous section.</xref >
1371
1374
</t >
1372
1375
<section title =" Identifying the root schema" >
1373
1376
<t >
1374
1377
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,
1376
1379
but no fragment).
1377
1380
</t >
1378
1381
</section >
1388
1391
<t >
1389
1392
The "$anchor" and "$dynamicAnchor" keywords are used to specify such
1390
1393
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".
1392
1395
</t >
1393
1396
<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"
1396
1399
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 >.
1399
1404
</t >
1400
1405
<t >
1401
- Separately from the usual usage of URIs , "$dynamicAnchor"
1406
+ Separately from the usual usage of IRIs , "$dynamicAnchor"
1402
1407
indicates that the fragment is an extension point when used with
1403
1408
the "$dynamicRef" keyword. This low-level, advanced feature
1404
1409
makes it easier to extend recursive schemas such as the meta-schemas,
1420
1425
<xref target =" xml-names" >NCName production</xref >.
1421
1426
<cref >
1422
1427
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.
1425
1430
</cref >
1426
1431
</t >
1427
1432
<t >
1439
1444
keywords, applying the referenced schema to the instance.
1440
1445
</t >
1441
1446
<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
1443
1448
the possibility to externalise or divide a schema across multiple files,
1444
1449
and provides the ability to validate recursive structures through
1445
1450
self-reference.
1446
1451
</t >
1447
1452
<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
1449
1454
locator, only an identifier. A schema need not be downloadable from the
1450
1455
address if it is a network-addressable URL, and implementations SHOULD NOT
1451
1456
assume they should perform a network operation when they encounter
1452
- a network-addressable URI .
1457
+ a network-addressable IRI .
1453
1458
</t >
1454
1459
1455
1460
<section title =' Direct References with "$ref"' anchor =" ref" >
1462
1467
</cref >
1463
1468
</t >
1464
1469
<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
1467
1472
to apply. This resolution is safe to perform on schema load, as the
1468
1473
process of evaluating an instance cannot change how the reference resolves.
1469
1474
</t >
1485
1490
</t >
1486
1491
<t >
1487
1492
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
1490
1495
resolution is safe to perform on schema load.
1491
1496
</t >
1492
1497
<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
1496
1501
resource in the <xref target =" scopes" >dynamic scope</xref > that defines
1497
1502
an identically named fragment with "$dynamicAnchor".
1498
1503
</t >
1589
1594
<t >
1590
1595
</t >
1591
1596
<section title =" Loading a Schema" >
1592
- <section title =" Initial Base URI " anchor =" initial-base" >
1597
+ <section title =" Initial Base IRI " anchor =" initial-base" >
1593
1598
<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.
1596
1602
</t >
1597
1603
<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
1599
1605
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.
1601
1607
</t >
1602
1608
<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
1605
1612
<xref target =" RFC3986" >RFC 3986 section 5</xref >.
1606
1613
</t >
1607
1614
<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.
1612
1620
</t >
1613
1621
<t >
1614
1622
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
1616
1624
media type.
1617
1625
</t >
1618
1626
<t >
1619
1627
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
1621
1629
schema document's root schema resource.
1622
1630
</t >
1623
1631
</section >
1624
1632
1625
1633
<section title =" Loading a referenced schema" >
1626
1634
<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,
1628
1636
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.
1630
1638
</t >
1631
1639
<t >
1632
1640
When schemas are downloaded,
1633
1641
for example by a generic user-agent that does not know until runtime which schemas to download,
1634
1642
see <xref target =" hypermedia" >Usage for Hypermedia</xref >.
1635
1643
</t >
1636
1644
<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
1640
1648
can be supplied to an implementation prior to processing instances, or may
1641
1649
be noted within a schema document as it is processed, producing associations
1642
1650
as shown in appendix <xref target =" idExamples" format =" counter" ></xref >.
1643
1651
</t >
1644
1652
<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.
1648
1656
</t >
1649
1657
</section >
1650
1658
1676
1684
1677
1685
<section title =" Dereferencing" >
1678
1686
<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,
1681
1689
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
1683
1691
<xref target =" RFC3986" >RFC 3986</xref >.
1684
1692
</t >
1685
1693
<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
1687
1695
within another schema document that has been made available to the implementation,
1688
1696
then that schema SHOULD be used automatically.
1689
1697
</t >
1714
1722
<t >
1715
1723
When an implementation encounters the < #/$defs/single> schema,
1716
1724
it resolves the "$anchor" value as a fragment name against the current
1717
- base URI to form < https://example.net/root.json#item> .
1725
+ base IRI to form < https://example.net/root.json#item> .
1718
1726
</t >
1719
1727
<t >
1720
1728
When an implementation then looks inside the < #/items> schema, it
1740
1748
<section title =" JSON Pointer fragments and embedded schema resources"
1741
1749
anchor =" embedded" >
1742
1750
<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
1744
1752
of the schema document, an embedded schema resource and its subschemas
1745
1753
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 .
1747
1755
</t >
1748
1756
<t >
1749
1757
Conceptually, a set of linked schema resources should behave
1753
1761
subschemas.
1754
1762
</t >
1755
1763
<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
1758
1766
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
1760
1768
locations within them.
1761
1769
</t >
1762
1770
<figure >
1776
1784
]]>
1777
1785
</artwork >
1778
1786
<postamble >
1779
- The URI "https://example.com/foo#/items/additionalProperties"
1787
+ The IRI "https://example.com/foo#/items/additionalProperties"
1780
1788
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,
1782
1790
is "https://example.com/bar#/additionalProperties".
1783
1791
</postamble >
1784
1792
</figure >
1785
1793
<figure >
1786
1794
<preamble >
1787
1795
Now consider the following two schema resources linked by reference
1788
- using a URI value for "$ref":
1796
+ using a IRI value for "$ref":
1789
1797
</preamble >
1790
1798
<artwork >
1791
1799
<![CDATA[
1803
1811
]]>
1804
1812
</artwork >
1805
1813
<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
1808
1816
beginning with "#/items/$ref" now resolves to nothing.
1809
1817
</postamble >
1810
1818
</figure >
1811
1819
<t >
1812
1820
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,
1815
1823
examining the resolved value and either using the "$id" (if the value
1816
1824
is a subschema), or resolving the reference and using the "$id" of the
1817
1825
reference target, is preferable.
1818
1826
</t >
1819
1827
<t >
1820
1828
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
1823
1831
schema interoperability.
1824
1832
<cref >
1825
1833
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,
1827
1835
given that all but one will be fragile if the schema resources
1828
1836
are reorganized. Some have argued that this is easy so there is
1829
1837
no point in forbidding it, while others have argued that it complicates
1832
1840
</cref >
1833
1841
</t >
1834
1842
<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
1837
1845
<xref target =" idExamples" format =" counter" ></xref >.
1838
1846
</t >
1839
1847
</section >
1854
1862
The bundling process for creating a Compound Schema Document is defined as taking
1855
1863
references (such as "$ref") to an external Schema Resource and embedding the referenced
1856
1864
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
1858
1866
documents do not require altering.
1859
1867
</t >
1860
1868
<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,
1862
1870
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 .
1864
1872
</t >
1865
1873
<t >
1866
1874
When the Schema Resource referenced by a by-reference applicator is bundled, it is RECOMMENDED that
1881
1889
<t >
1882
1890
In order to produce identical output, references in the containing schema document to the
1883
1891
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
1885
1893
or paths used in resulting annotations or errors.
1886
1894
</t >
1887
1895
<t >
2051
2059
</t >
2052
2060
<t >
2053
2061
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.
2055
2063
</t >
2056
2064
<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:
2058
2066
< https://json-schema.org/draft/2020-12/vocab/applicator> .
2059
2067
</t >
2060
2068
<t >
2061
- The current URI for the corresponding meta-schema is:
2069
+ The current IRI for the corresponding meta-schema is:
2062
2070
<eref target =" https://json-schema.org/draft/2020-12/meta/applicator" />.
2063
2071
</t >
2064
2072
<t >
2065
- Updated vocabulary and meta-schema URIs MAY be published between
2073
+ Updated vocabulary and meta-schema IRIs MAY be published between
2066
2074
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
2068
2076
before the next to indicate the same syntax and semantics
2069
2077
as those listed here.
2070
2078
</t >
2496
2504
</t >
2497
2505
<t >
2498
2506
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.
2500
2508
</t >
2501
2509
<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
2503
2511
vocabulary, is:
2504
2512
< https://json-schema.org/draft/2020-12/vocab/unevaluated> .
2505
2513
</t >
2705
2713
<section title =" Keyword Absolute Location" >
2706
2714
<t >
2707
2715
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
2709
2717
schema object, and it MUST NOT include by-reference applicators
2710
2718
such as "$ref" or "$dynamicRef" as non-terminal path components.
2711
2719
It MAY end in such keywords if the error or annotation is for that
2712
2720
keyword, such as an unresolvable reference.
2713
2721
<cref >
2714
2722
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).
2717
2725
Keyword absolute locations will have a fragment in order to
2718
2726
identify the keyword.
2719
2727
</cref >
@@ -2727,7 +2735,7 @@ https://example.com/schemas/common#/$defs/count/minimum
2727
2735
</figure >
2728
2736
<t >
2729
2737
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".
2731
2739
</t >
2732
2740
<t >
2733
2741
The JSON key for this information is "absoluteKeywordLocation".
@@ -3014,7 +3022,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3014
3022
</t >
3015
3023
<t >
3016
3024
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:
3018
3026
<eref target =" https://json-schema.org/draft/2020-12/output/verbose-example" />.
3019
3027
</t >
3020
3028
<figure >
@@ -3076,7 +3084,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3076
3084
<section title =" Output validation schemas" >
3077
3085
<t >
3078
3086
For convenience, JSON Schema has been provided to validate output generated
3079
- by implementations. Its URI is:
3087
+ by implementations. Its IRI is:
3080
3088
<eref target =" https://json-schema.org/draft/2020-12/output/schema" />.
3081
3089
</t >
3082
3090
</section >
@@ -3135,7 +3143,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3135
3143
Optional parameters:
3136
3144
<list style =" hanging" >
3137
3145
<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
3139
3147
a JSON Schema resource. The instance SHOULD successfully
3140
3148
validate against at least one of these meta-schemas.
3141
3149
Non-validating meta-schemas MAY be included for purposes such
@@ -3179,7 +3187,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3179
3187
Required parameters:
3180
3188
<list style =" hanging" >
3181
3189
<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
3183
3191
a JSON Schema resource. The instance SHOULD successfully
3184
3192
validate against at least one of these schemas.
3185
3193
Non-validating schemas MAY be included for purposes such
@@ -3219,6 +3227,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3219
3227
<references title =" Normative References" >
3220
3228
&RFC2119;
3221
3229
&RFC3986;
3230
+ &RFC3987;
3222
3231
&RFC6839;
3223
3232
&RFC6901;
3224
3233
&RFC8259;
@@ -3334,84 +3343,84 @@ https://example.com/schemas/common#/$defs/count/minimum
3334
3343
<t >
3335
3344
The schemas at the following URI-encoded <xref target =" RFC6901" >JSON
3336
3345
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
3338
3347
sections <xref target =" fragments" format =" counter" ></xref > and
3339
3348
<xref target =" embedded" format =" counter" ></xref > above.
3340
3349
</t >
3341
3350
<t >
3342
3351
<list style =" hanging" >
3343
3352
<t hangText =" # (document root)" >
3344
3353
<list style =" hanging" >
3345
- <t hangText =" canonical absolute-URI (and also base URI )" >
3354
+ <t hangText =" canonical absolute-IRI (and also base IRI )" >
3346
3355
https://example.com/root.json
3347
3356
</t >
3348
- <t hangText =" canonical URI with pointer fragment" >
3357
+ <t hangText =" canonical IRI with pointer fragment" >
3349
3358
https://example.com/root.json#
3350
3359
</t >
3351
3360
</list >
3352
3361
</t >
3353
3362
<t hangText =" #/$defs/A" >
3354
3363
<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" >
3357
3366
https://example.com/root.json#foo
3358
3367
</t >
3359
- <t hangText =" canonical URI with pointer fragment" >
3368
+ <t hangText =" canonical IRI with pointer fragment" >
3360
3369
https://example.com/root.json#/$defs/A
3361
3370
</t >
3362
3371
</list >
3363
3372
</t >
3364
3373
<t hangText =" #/$defs/B" >
3365
3374
<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" >
3368
3377
https://example.com/other.json#
3369
3378
</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" >
3371
3380
https://example.com/root.json#/$defs/B
3372
3381
</t >
3373
3382
</list >
3374
3383
</t >
3375
3384
<t hangText =" #/$defs/B/$defs/X" >
3376
3385
<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" >
3379
3388
https://example.com/other.json#bar
3380
3389
</t >
3381
- <t hangText =" canonical URI with pointer fragment" >
3390
+ <t hangText =" canonical IRI with pointer fragment" >
3382
3391
https://example.com/other.json#/$defs/X
3383
3392
</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" >
3385
3394
https://example.com/root.json#/$defs/B/$defs/X
3386
3395
</t >
3387
3396
</list >
3388
3397
</t >
3389
3398
<t hangText =" #/$defs/B/$defs/Y" >
3390
3399
<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" >
3393
3402
https://example.com/t/inner.json#bar
3394
3403
</t >
3395
- <t hangText =" canonical URI with pointer fragment" >
3404
+ <t hangText =" canonical IRI with pointer fragment" >
3396
3405
https://example.com/t/inner.json#
3397
3406
</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" >
3399
3408
https://example.com/other.json#/$defs/Y
3400
3409
</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" >
3402
3411
https://example.com/root.json#/$defs/B/$defs/Y
3403
3412
</t >
3404
3413
</list >
3405
3414
</t >
3406
3415
<t hangText =" #/$defs/C" >
3407
3416
<list style =" hanging" >
3408
- <t hangText =" base URI " >
3417
+ <t hangText =" base IRI " >
3409
3418
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f
3410
3419
</t >
3411
- <t hangText =" canonical URI with pointer fragment" >
3420
+ <t hangText =" canonical IRI with pointer fragment" >
3412
3421
urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f#
3413
3422
</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" >
3415
3424
https://example.com/root.json#/$defs/C
3416
3425
</t >
3417
3426
</list >
@@ -3442,8 +3451,8 @@ https://example.com/schemas/common#/$defs/count/minimum
3442
3451
</t >
3443
3452
<t >
3444
3453
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
3447
3456
as the "$id" in their root schema.
3448
3457
</t >
3449
3458
<t >
@@ -3452,7 +3461,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3452
3461
schema objects, and without changing any aspect of validation or
3453
3462
annotation results. The names of the schemas under "$defs" do
3454
3463
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.
3456
3465
</t >
3457
3466
</section >
3458
3467
<section title =" Reference removal is not always safe" >
@@ -3521,7 +3530,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3521
3530
<t >
3522
3531
When we load these two schemas, we will notice the "$dynamicAnchor"
3523
3532
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 :
3525
3534
<list style =" symbols" >
3526
3535
<t >"https://example.com/tree#node"</t >
3527
3536
<t >"https://example.com/strict-tree#node"</t >
@@ -3532,9 +3541,9 @@ https://example.com/schemas/common#/$defs/count/minimum
3532
3541
<t >
3533
3542
If we apply the "strict-tree" schema to the instance, we will follow
3534
3543
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)
3536
3545
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
3538
3547
created by "$dynamicAnchor". Therefore we must examine the dynamic
3539
3548
scope before following the reference.
3540
3549
</t >
@@ -3738,7 +3747,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3738
3747
The standard meta-schemas that combine all vocabularies defined by
3739
3748
the Core and Validation specification, and that combine all vocabularies
3740
3749
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
3742
3751
meta-schemas may be found in the Validation and Hyper-Schema specifications,
3743
3752
respectively.
3744
3753
</t >
0 commit comments