@@ -39,11 +39,11 @@ such as output formats.
39
39
40
40
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
41
41
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
42
- interpreted as described in [ RFC 2119] ( # rfc2119) .
42
+ interpreted as described in [ RFC 2119] ( https://www.rfc-editor.org/info/ rfc2119) .
43
43
44
44
The terms "JSON", "JSON text", "JSON value", "member", "element", "object",
45
45
"array", "number", "string", "boolean", "true", "false", and "null" in this
46
- document are to be interpreted as defined in [ RFC 8259] ( # rfc8259) .
46
+ document are to be interpreted as defined in [ RFC 8259] ( https://www.rfc-editor.org/info/ rfc8259) .
47
47
48
48
## Overview
49
49
@@ -242,10 +242,10 @@ are using.
242
242
243
243
#### Root Schema and Subschemas and Resources {#root}
244
244
245
- A JSON Schema resource is a schema which is [ canonically] ( # rfc6596) identified
246
- by an [ absolute IRI] ( # rfc3987) . Schema resources MAY also be identified by IRIs,
245
+ A JSON Schema resource is a schema which is [ canonically] ( https://www.rfc-editor.org/info/ rfc6596) identified
246
+ by an [ absolute IRI] ( https://www.rfc-editor.org/info/ rfc3987) . Schema resources MAY also be identified by IRIs,
247
247
including IRIs with fragments, if the resulting secondary resource (as defined
248
- by [ section 3.5 of RFC 3986] ( # rfc3986) ) is identical to the primary resource.
248
+ by [ section 3.5 of RFC 3986] ( https://www.rfc-editor.org/info/ rfc3986) ) is identical to the primary resource.
249
249
This can occur with the empty fragment, or when one schema resource is embedded
250
250
in another. Any such IRIs with fragments are considered to be non-canonical.
251
251
@@ -285,7 +285,7 @@ are processed in the same way, with the same available behaviors.
285
285
286
286
## Fragment Identifiers {#fragments}
287
287
288
- In accordance with section 3.1 of [ RFC 6839] ( # rfc6839) , the syntax and semantics
288
+ In accordance with section 3.1 of [ RFC 6839] ( https://www.rfc-editor.org/info/ rfc6839) , the syntax and semantics
289
289
of fragment identifiers specified for any +json media type SHOULD be as
290
290
specified for ` application/json ` . (At publication of this document, there is no
291
291
fragment identification syntax defined for ` application/json ` .)
@@ -296,7 +296,7 @@ identifier structures: plain names and JSON Pointers. The
296
296
structure: JSON Pointers.
297
297
298
298
The use of JSON Pointers as IRI fragment identifiers is described in [ RFC
299
- 6901] ( # rfc6901) . For ` application/schema+json ` , which supports two fragment
299
+ 6901] ( https://www.rfc-editor.org/info/ rfc6901) . For ` application/schema+json ` , which supports two fragment
300
300
identifier syntaxes, fragment identifiers matching the JSON Pointer syntax,
301
301
including the empty string, MUST be interpreted as JSON Pointer fragment
302
302
identifiers.
@@ -306,9 +306,9 @@ identifiers](#w3cwd-fragid-best-practices-20121025), plain name fragment
306
306
identifiers in ` application/schema+json ` are reserved for referencing locally
307
307
named schemas.
308
308
309
- Plain name fragments MUST follow XML's [ ` NCName ` production] ( # xml-names ) , which
309
+ Plain name fragments MUST follow XML's [ ` NCName ` production] ( http://www.w3.org/TR/2006/REC- xml-names11-20060816 ) , which
310
310
allows for compatibility with the recommended plain name
311
- [ syntax] ( #w3crec -xptr-framework-20030325) for XML-based media types. For
311
+ [ syntax] ( https://www.w3.org/TR/2003/REC -xptr-framework-20030325/ ) for XML-based media types. For
312
312
convenience, the ` NCName ` syntax is reproduced here in ABNF form, using
313
313
a minimal set of rules:
314
314
@@ -336,7 +336,7 @@ keyword](#anchors) section.
336
336
337
337
### Range of JSON Values
338
338
339
- An instance may be any valid JSON value as defined by [ JSON] ( # rfc8259) . JSON
339
+ An instance may be any valid JSON value as defined by [ JSON] ( https://www.rfc-editor.org/info/ rfc8259) . JSON
340
340
Schema imposes no restrictions on type: JSON Schema can describe any JSON value,
341
341
including, for example, null.
342
342
@@ -352,7 +352,7 @@ describable by JSON.
352
352
Keywords MAY use regular expressions to express constraints, or constrain the
353
353
instance value to be a regular expression. These regular expressions SHOULD be
354
354
valid according to the regular expression dialect described in [ ECMA-262,
355
- section 21.2.1] ( #ecma262 ) .
355
+ section 21.2.1] ( https://www.ecma-international.org/ecma-262/11.0/index.html ) .
356
356
357
357
Unless otherwise specified by a keyword, regular expressions MUST NOT be
358
358
considered to be implicitly anchored at either end. All regular expression
@@ -367,7 +367,7 @@ schema authors SHOULD limit themselves to the following regular expression
367
367
tokens:
368
368
369
369
- individual Unicode characters, as defined by the [ JSON
370
- specification] ( # rfc8259) ;
370
+ specification] ( https://www.rfc-editor.org/info/ rfc8259) ;
371
371
- simple atoms: ` . ` (any character except line terminator);
372
372
- simple character classes (` [abc] ` ), range character classes (` [a-z] ` );
373
373
- complemented simple character classes (` [^abc] ` );
@@ -653,7 +653,7 @@ behalf of applications.
653
653
654
654
Unless otherwise specified, the value of an annotation keyword is the keyword's
655
655
value. However, other behaviors are possible. For example, [ JSON
656
- Hyper-Schema's] ( #json-hyper- schema) ` links ` keyword is a complex annotation that
656
+ Hyper-Schema's] ( https://datatracker.ietf.org/doc/html/draft-handrews-json- schema-hyperschema-02 ) ` links ` keyword is a complex annotation that
657
657
produces a value based in part on the instance data.
658
658
659
659
While "short-circuit" evaluation is possible for assertions, collecting
@@ -685,7 +685,7 @@ based on the schema location that contributed the value. This is intended to
685
685
allow flexible usage. Collecting the schema location facilitates such usage.
686
686
687
687
For example, consider this schema, which uses annotations and assertions from
688
- the [ Validation specification] ( #json-schema -validation) :
688
+ the [ Validation specification] ( ./jsonschema -validation) :
689
689
690
690
Note that some lines are wrapped for clarity.
691
691
@@ -880,7 +880,7 @@ applies to the resource in which it is declared as well as any embedded schema
880
880
resources, unless such a resource itself declares a different dialect by
881
881
including the ` $schema ` keyword with a different value.
882
882
883
- The value of this keyword MUST be an [ IRI] ( # rfc3987) (containing a scheme) and
883
+ The value of this keyword MUST be an [ IRI] ( https://www.rfc-editor.org/info/ rfc3987) (containing a scheme) and
884
884
this IRI MUST be normalized.
885
885
886
886
If this IRI identifies a retrievable resource, that resource SHOULD be of media
@@ -896,26 +896,26 @@ by other parties.
896
896
### Base IRI, Anchors, and Dereferencing
897
897
898
898
To differentiate between schemas in a vast ecosystem, schema resources are
899
- identified by [ absolute IRIs] ( # rfc3987) (without fragments). These identifiers
899
+ identified by [ absolute IRIs] ( https://www.rfc-editor.org/info/ rfc3987) (without fragments). These identifiers
900
900
are used to create references between schema resources. When comparing IRIs for
901
901
the purposes of resource identification, implementations SHOULD first follow the
902
- IRI normalization procedures defined in [ RFC 3987] ( # rfc3987) , section 5.3.
902
+ IRI normalization procedures defined in [ RFC 3987] ( https://www.rfc-editor.org/info/ rfc3987) , section 5.3.
903
903
904
- Several keywords can accept a relative [ IRI reference] ( # rfc3987) , or a value
904
+ Several keywords can accept a relative [ IRI reference] ( https://www.rfc-editor.org/info/ rfc3987) , or a value
905
905
used to construct a relative IRI reference. For these keywords, it is necessary
906
906
to establish a base IRI in order to resolve the reference.
907
907
908
908
#### The ` $id ` Keyword {#id-keyword}
909
909
910
910
An ` $id ` keyword in a schema or subschema identifies that schema or subschema as
911
911
a distinct schema resource. The value for this keyword MUST be a string, and
912
- MUST represent a valid [ IRI reference] ( # rfc3987) without a fragment.
912
+ MUST represent a valid [ IRI reference] ( https://www.rfc-editor.org/info/ rfc3987) without a fragment.
913
913
914
914
When the value of this keyword is resolved against the current base IRI, the
915
915
resulting absolute IRI then serves as the identifier for the schema resource and
916
916
as a base IRI for relative IRI references in keywords within that schema
917
917
resource and for embedded schema resources, in accordance with [ RFC 3987 section
918
- 6.5] ( # rfc3987) and [ RFC 3986 section 5.1.1] ( # rfc3986) regarding base IRIs
918
+ 6.5] ( https://www.rfc-editor.org/info/ rfc3987) and [ RFC 3986 section 5.1.1] ( https://www.rfc-editor.org/info/ rfc3986) regarding base IRIs
919
919
embedded in content and RFC 3986 section 5.1.2 regarding encapsulating entities.
920
920
921
921
Note that this IRI is an identifier and not necessarily a network locator. In
@@ -933,7 +933,7 @@ given in {{initial-base}}.
933
933
##### Identifying the root schema
934
934
935
935
The root schema of a JSON Schema document SHOULD contain an ` $id ` keyword with
936
- an [ absolute IRI] ( # rfc3987) (containing a scheme, but no fragment).
936
+ an [ absolute IRI] ( https://www.rfc-editor.org/info/ rfc3987) (containing a scheme, but no fragment).
937
937
938
938
#### Defining location-independent identifiers {#anchors}
939
939
@@ -951,7 +951,8 @@ fragments, rather than absolute IRIs as seen with `$id`.
951
951
keyword is appended to the IRI of the schema resource containing it. As
952
952
discussed in {{id-keyword}}, this is either the nearest ` $id ` in the same or an
953
953
ancestor schema object, or the base IRI for the document as determined according
954
- to [ RFC 3987] ( #rfc3987 ) and [ RFC 3986] ( #rfc3986 ) .
954
+ to [ RFC 3987] ( https://www.rfc-editor.org/info/rfc3987 ) and
955
+ [ RFC 3986] ( https://www.rfc-editor.org/info/rfc3986 ) .
955
956
956
957
In contrast, ` $dynamicAnchor ` operates independently of resource IRIs and is
957
958
instead dependent on the dynamic scope of the evaluation. ` $dynamicAnchor `
@@ -1086,20 +1087,20 @@ MUST NOT be collected as an annotation result.
1086
1087
1087
1088
#### Initial Base IRI {#initial-base}
1088
1089
1089
- [ RFC 3987 Section 6.5] ( # rfc3987) and [ RFC 3986 Section 5.1] ( # rfc3986) defines
1090
+ [ RFC 3987 Section 6.5] ( https://www.rfc-editor.org/info/ rfc3987) and [ RFC 3986 Section 5.1] ( https://www.rfc-editor.org/info/ rfc3986) defines
1090
1091
how to determine the default base IRI of a document.
1091
1092
1092
1093
Informatively, the initial base IRI of a schema is the IRI at which it was
1093
1094
found, whether that was a network location, a local filesystem, or any other
1094
1095
situation identifiable by a IRI of any known scheme.
1095
1096
1096
1097
If a schema document defines no explicit base IRI with ` $id ` (embedded in
1097
- content), the base IRI is that determined per [ RFC 3987 Section 6.5] ( # rfc3987)
1098
- and [ RFC 3986 section 5] ( # rfc3986) .
1098
+ content), the base IRI is that determined per [ RFC 3987 Section 6.5] ( https://www.rfc-editor.org/info/ rfc3987)
1099
+ and [ RFC 3986 section 5] ( https://www.rfc-editor.org/info/ rfc3986) .
1099
1100
1100
1101
If no source is known, or no IRI scheme is known for the source, a suitable
1101
1102
implementation-specific default IRI MAY be used as described in [ RFC 3987
1102
- Section 6.5] ( # rfc3987) and [ RFC 3986 Section 5.1.4] ( # rfc3986) . It is RECOMMENDED
1103
+ Section 6.5] ( https://www.rfc-editor.org/info/ rfc3987) and [ RFC 3986 Section 5.1.4] ( https://www.rfc-editor.org/info/ rfc3986) . It is RECOMMENDED
1103
1104
that implementations document any default base IRI that they assume.
1104
1105
1105
1106
If a schema object is embedded in a document of another media type, then the
@@ -1151,7 +1152,7 @@ expect such features to be interoperable across implementations.
1151
1152
Schemas can be identified by any IRI that has been given to them, including a
1152
1153
JSON Pointer or their IRI given directly by ` $id ` . In all cases, dereferencing a
1153
1154
` $ref ` reference involves first resolving its value as a IRI reference against
1154
- the current base IRI per [ RFC 3986] ( # rfc3986) .
1155
+ the current base IRI per [ RFC 3986] ( https://www.rfc-editor.org/info/ rfc3986) .
1155
1156
1156
1157
If the resulting IRI identifies a schema within the current document, or within
1157
1158
another schema document that has been made available to the implementation, then
@@ -1423,24 +1424,24 @@ all annotation results), would result in a resolution failure.
1423
1424
JSON has been adopted widely by HTTP servers for automated APIs and robots. This
1424
1425
section describes how to enhance processing of JSON documents in a more RESTful
1425
1426
manner when used with protocols that support media types and [ Web
1426
- linking] ( # rfc8288) .
1427
+ linking] ( https://www.rfc-editor.org/info/ rfc8288) .
1427
1428
1428
1429
##### Linking to a Schema
1429
1430
1430
1431
It is RECOMMENDED that instances described by a schema provide a link to a
1431
1432
downloadable JSON Schema using the link relation "describedby", as defined by
1432
- [ Linked Data Protocol 1.0, section 8.1] ( #w3crec -ldp-20150226) .
1433
+ [ Linked Data Protocol 1.0, section 8.1] ( https://www.w3.org/TR/2015/REC -ldp-20150226) .
1433
1434
1434
1435
In HTTP, such links can be attached to any response using the [ Link
1435
- header] ( # rfc8288) . An example of such a header would be:
1436
+ header] ( https://www.rfc-editor.org/info/ rfc8288) . An example of such a header would be:
1436
1437
1437
1438
```
1438
1439
Link: <https://example.com/my-hyper-schema>; rel="describedby"
1439
1440
```
1440
1441
1441
1442
##### Usage Over HTTP
1442
1443
1443
- When used for hypermedia systems over a network, [ HTTP] ( # rfc7231) is frequently
1444
+ When used for hypermedia systems over a network, [ HTTP] ( https://www.rfc-editor.org/info/ rfc7231) is frequently
1444
1445
the protocol of choice for distributing schemas. Misbehaving clients can pose
1445
1446
problems for server maintainers if they pull a schema over the network more
1446
1447
frequently than necessary, when it's instead possible to cache a schema for a
@@ -1954,7 +1955,7 @@ SHOULD use the terms defined by this document to do so.
1954
1955
## Security Considerations {#security}
1955
1956
1956
1957
Both schemas and instances are JSON values. As such, all security considerations
1957
- defined in [ RFC 8259] ( # rfc8259) apply.
1958
+ defined in [ RFC 8259] ( https://www.rfc-editor.org/info/ rfc8259) apply.
1958
1959
1959
1960
Instances and schemas are both frequently written by untrusted third parties, to
1960
1961
be deployed on public Internet servers. Implementations should take care that
@@ -1993,7 +1994,7 @@ Subtype name:: schema+json
1993
1994
Required parameters:: N/A
1994
1995
1995
1996
Encoding considerations:: Encoding considerations are identical to those
1996
- specified for the ` application/json ` media type. See [ JSON] ( # rfc8259) .
1997
+ specified for the ` application/json ` media type. See [ JSON] ( https://www.rfc-editor.org/info/ rfc8259) .
1997
1998
1998
1999
Security considerations:: See {{security}} above.
1999
2000
@@ -2014,7 +2015,7 @@ Subtype name:: schema-instance+json
2014
2015
Required parameters:: N/A
2015
2016
2016
2017
Encoding considerations:: Encoding considerations are identical to those
2017
- specified for the ` application/json ` media type. See [ JSON] ( # rfc8259) .
2018
+ specified for the ` application/json ` media type. See [ JSON] ( https://www.rfc-editor.org/info/ rfc8259) .
2018
2019
2019
2020
Security considerations:: See {{security}} above.
2020
2021
@@ -2023,116 +2024,6 @@ Interoperability considerations:: See Sections [6.2](#language),
2023
2024
2024
2025
Fragment identifier considerations:: See {{fragments}}
2025
2026
2026
- ## References
2027
-
2028
- ### Normative References
2029
-
2030
- #### [ RFC2119] {#rfc2119}
2031
-
2032
- Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14,
2033
- RFC 2119, DOI 10.17487/RFC2119, March 1997,
2034
- << https://www.rfc-editor.org/info/rfc2119 > >.
2035
-
2036
- #### [ RFC3986] {#rfc3986}
2037
-
2038
- Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier
2039
- (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005,
2040
- << https://www.rfc-editor.org/info/rfc3986 > >.
2041
-
2042
- #### [ RFC3987] {#rfc3987}
2043
-
2044
- Duerst, M. and M. Suignard, "Internationalized Resource Identifiers (IRIs)", RFC
2045
- 3987, DOI 10.17487/RFC3987, January 2005,
2046
- << https://www.rfc-editor.org/info/rfc3987 > >.
2047
-
2048
- #### [ RFC6839] {#rfc6839}
2049
-
2050
- Hansen, T. and A. Melnikov, "Additional Media Type Structured Syntax Suffixes",
2051
- RFC 6839, DOI 10.17487/RFC6839, January 2013,
2052
- << https://www.rfc-editor.org/info/rfc6839 > >.
2053
-
2054
- #### [ RFC6901] {#rfc6901}
2055
-
2056
- Bryan, P., Ed., Zyp, K., and M. Nottingham, Ed., "JavaScript Object Notation
2057
- (JSON) Pointer", RFC 6901, DOI 10.17487/RFC6901, April 2013,
2058
- << https://www.rfc-editor.org/info/rfc6901 > >.
2059
-
2060
- #### [ RFC8259] {#rfc8259}
2061
-
2062
- Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format",
2063
- STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017,
2064
- << https://www.rfc-editor.org/info/rfc8259 > >.
2065
-
2066
- #### [ W3C.REC-ldp-20150226] {#w3crec-ldp-20150226}
2067
-
2068
- Malhotra, A., Ed., Arwe, J., Ed., and S. Speicher, Ed., "Linked Data Platform
2069
- 1.0", W3C REC REC-ldp-20150226, W3C REC-ldp-20150226, 26 February 2015,
2070
- << https://www.w3.org/TR/2015/REC-ldp-20150226/ > >.
2071
-
2072
- #### [ ecma262] {#ecma262}
2073
-
2074
- "ECMA-262, 11th edition specification", June 2020,
2075
- << https://www.ecma-international.org/ecma-262/11.0/index.html > >.
2076
-
2077
- ### Informative References
2078
-
2079
- #### [ RFC6596] {#rfc6596}
2080
-
2081
- Ohye, M. and J. Kupke, "The Canonical Link Relation", RFC 6596, DOI
2082
- 10.17487/RFC6596, April 2012, << https://www.rfc-editor.org/info/rfc6596 > >.
2083
-
2084
- #### [ RFC7049] {#rfc7049}
2085
-
2086
- Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC
2087
- 7049, DOI 10.17487/RFC7049, October 2013,
2088
- << https://www.rfc-editor.org/info/rfc7049 > >.
2089
-
2090
- #### [ RFC7231] {#rfc7231}
2091
-
2092
- Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1):
2093
- Semantics and Content", RFC 7231, DOI 10.17487/RFC7231, June 2014,
2094
- << https://www.rfc-editor.org/info/rfc7231 > >.
2095
-
2096
- #### [ RFC8288] {#rfc8288}
2097
-
2098
- Nottingham, M., "Web Linking", RFC 8288, DOI 10.17487/RFC8288, October 2017,
2099
- << https://www.rfc-editor.org/info/rfc8288 > >.
2100
-
2101
- #### [ W3C.WD-fragid-best-practices-20121025]
2102
- {#w3cwd-fragid-best-practices-20121025}
2103
-
2104
- Tennison, J., Ed., "Best Practices for Fragment Identifiers and Media Type
2105
- Definitions", W3C WD WD-fragid-best-practices-20121025, W3C
2106
- WD-fragid-best-practices-20121025, 25 October 2012,
2107
- << https://www.w3.org/TR/2012/WD-fragid-best-practices-20121025/ > >.
2108
-
2109
- #### [ W3C.REC-xptr-framework-20030325] {#w3crec-xptr-framework-20030325}
2110
-
2111
- Maler, E., Ed., Marsh, J., Ed., Walsh, N., Ed., and P. Grosso, Ed., "XPointer
2112
- Framework", W3C REC REC-xptr-framework-20030325, W3C
2113
- REC-xptr-framework-20030325, 25 March 2003,
2114
- << https://www.w3.org/TR/2003/REC-xptr-framework-20030325/ > >.
2115
-
2116
- #### [ json-schema-validation] {#json-schema-validation}
2117
-
2118
- Wright, A., Andrews, H., and B. Hutton, "JSON Schema Validation: A Vocabulary
2119
- for Structural Validation of JSON", Work in Progress, Internet-Draft,
2120
- draft-bhutton-json-schema-validation-01, June 2022,
2121
- << https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01 > >.
2122
-
2123
- #### [ json-hyper-schema] {#json-hyper-schema}
2124
-
2125
- Andrews, H. and A. Wright, "JSON Hyper-Schema: A Vocabulary for Hypermedia
2126
- Annotation of JSON", Work in Progress, Internet-Draft,
2127
- draft-handrews-json-schema-hyperschema-02, November 2017,
2128
- << https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-02 > >.
2129
-
2130
- #### [ xml-names] {#xml-names}
2131
-
2132
- Bray, T., Ed., Hollander, D., Ed., Layman, A., Ed., and R. Tobin, Ed.,
2133
- "Namespaces in XML 1.1 (Second Edition)", August 2006,
2134
- << http://www.w3.org/TR/2006/REC-xml-names11-20060816 > >.
2135
-
2136
2027
## %appendix% Schema identification examples {#idexamples}
2137
2028
2138
2029
Consider the following schema, which shows ` $id ` being used to identify both the
@@ -2162,7 +2053,7 @@ name fragment identifiers.
2162
2053
```
2163
2054
2164
2055
The schemas at the following locations (indicated by plain
2165
- [ JSON Pointers] ( # rfc6901) relative to the root document) have the following base
2056
+ [ JSON Pointers] ( https://www.rfc-editor.org/info/ rfc6901) relative to the root document) have the following base
2166
2057
IRIs, and are identifiable by any listed IRI in accordance with {{fragments}}
2167
2058
and {{embedded}} above.
2168
2059
0 commit comments