5
5
<!ENTITY RFC6839 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.6839.xml" >
6
6
<!ENTITY RFC6901 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.6901.xml" >
7
7
<!ENTITY RFC7049 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.7049.xml" >
8
- <!ENTITY RFC7159 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.7159 .xml" >
8
+ <!ENTITY RFC8259 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.8259 .xml" >
9
9
<!ENTITY RFC7231 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.7231.xml" >
10
10
<!ENTITY RFC8288 SYSTEM " http://xml.resource.org/public/rfc/bibxml/reference.RFC.8288.xml" >
11
11
<!ENTITY ldp SYSTEM " https://xml2rfc.tools.ietf.org/public/rfc/bibxml4/reference.W3C.REC-ldp-20150226.xml" >
30
30
</author >
31
31
32
32
<author fullname =" Henry Andrews" initials =" H" surname =" Andrews" role =" editor" >
33
- <organization >Cloudflare, Inc.</organization >
34
33
<address >
35
34
<postal >
36
35
<street ></street >
108
107
<t >
109
108
The terms "JSON", "JSON text", "JSON value", "member", "element", "object", "array",
110
109
"number", "string", "boolean", "true", "false", and "null" in this document are to
111
- be interpreted as defined in <xref target =" RFC7159 " >RFC 7159 </xref >.
110
+ be interpreted as defined in <xref target =" RFC8259 " >RFC 8259 </xref >.
112
111
</t >
113
112
</section >
114
113
132
131
Applicators apply subschemas to parts of the instance and combine
133
132
their results.
134
133
</t >
134
+ <t >
135
+ Extension keywords SHOULD stay within these categories, keeping in mind
136
+ that annotations in particular are extremely flexible. Complex behavior
137
+ is usually better delegated to applications on the basis of annotation
138
+ data than implemented directly as schema keywords. However, extension
139
+ keywords MAY define other behaviors for specialized purposes.
140
+ </t >
135
141
<t >
136
142
Evaluating an instance against a schema involves processing all of the
137
143
keywords in the schema against the appropriate locations within the instance.
146
152
subschemas have been evaluated, although in some circumstance evaluation
147
153
may be short-circuited due to assertion results.
148
154
</t >
149
- <t >
150
- Keyword behavior MAY be defined in terms of the annotation results
151
- of <xref target =" root" >subschemas</xref > and/or adjacent keywords.
152
- Such keywords MUST NOT result in a circular dependency.
153
- Keywords MAY modify their behavior based on the presence or absence
154
- of another keyword in the same
155
- <xref target =" schema-document" >schema object</xref >.
156
- </t >
157
- <t >
158
- A missing keyword MUST NOT produce a false assertion result, MUST
159
- NOT produce annotation results, and MUST NOT cause any other schema
160
- to be evaluated as part of its own behavioral definition.
161
- However, given that missing keywords do not contribute annotations,
162
- the lack of annotation results may indirectly change the behavior
163
- of other keywords.
164
- </t >
165
- <t >
166
- In some cases, the missing keyword assertion behavior of a keyword is
167
- identical to that produced by a certain value, and keyword definitions
168
- SHOULD note such values where known. However, even if the value which
169
- produces the default behavior would produce annotation results if
170
- present, the default behavior still MUST NOT result in annotations.
171
- </t >
172
- <t >
173
- Because annotation collection can add significant cost in terms of both
174
- computation and memory, implementations MAY opt out of this feature.
175
- Keywords known to an implementation to have assertion or applicator behavior
176
- that depend on annotation results MUST then be treated as errors, unless
177
- an alternate implementation producing the same behavior is available.
178
- Keywords of this sort SHOULD describe reasonable alternate approaches
179
- when appropriate. This approach is demonstrated by the
180
- "<xref target =" additionalItems" format =" title" />" and
181
- "<xref target =" additionalProperties" format =" title" />" keywords in this
182
- document.
183
- </t >
184
- <t >
185
- Extension keywords SHOULD stay within these categories, keeping in mind
186
- that annotations in particular are extremely flexible. Complex behavior
187
- is usually better delegated to applications on the basis of annotation
188
- data than implemented directly as schema keywords. However, extension
189
- keywords MAY define other behaviors for specialized purposes.
190
- </t >
155
+ <section title =" Keyword Interactions" >
156
+ <t >
157
+ Keyword behavior MAY be defined in terms of the annotation results
158
+ of <xref target =" root" >subschemas</xref > and/or adjacent keywords.
159
+ Such keywords MUST NOT result in a circular dependency.
160
+ Keywords MAY modify their behavior based on the presence or absence
161
+ of another keyword in the same
162
+ <xref target =" schema-document" >schema object</xref >.
163
+ </t >
164
+ </section >
165
+ <section title =" Default Behaviors" >
166
+ <t >
167
+ A missing keyword MUST NOT produce a false assertion result, MUST
168
+ NOT produce annotation results, and MUST NOT cause any other schema
169
+ to be evaluated as part of its own behavioral definition.
170
+ However, given that missing keywords do not contribute annotations,
171
+ the lack of annotation results may indirectly change the behavior
172
+ of other keywords.
173
+ </t >
174
+ <t >
175
+ In some cases, the missing keyword assertion behavior of a keyword is
176
+ identical to that produced by a certain value, and keyword definitions
177
+ SHOULD note such values where known. However, even if the value which
178
+ produces the default behavior would produce annotation results if
179
+ present, the default behavior still MUST NOT result in annotations.
180
+ </t >
181
+ <t >
182
+ Because annotation collection can add significant cost in terms of both
183
+ computation and memory, implementations MAY opt out of this feature.
184
+ Keywords known to an implementation to have assertion or applicator behavior
185
+ that depend on annotation results MUST then be treated as errors, unless
186
+ an alternate implementation producing the same behavior is available.
187
+ Keywords of this sort SHOULD describe reasonable alternate approaches
188
+ when appropriate. This approach is demonstrated by the
189
+ "<xref target =" additionalItems" format =" title" />" and
190
+ "<xref target =" additionalProperties" format =" title" />" keywords in this
191
+ document.
192
+ </t >
193
+ </section >
191
194
<section title =" Applicators" anchor =" applicators" >
192
195
<t >
193
196
Applicators allow for building more complex schemas than can be accomplished
641
644
642
645
<section title =" Range of JSON Values" >
643
646
<t >
644
- An instance may be any valid JSON value as defined by <xref target =" RFC7159 " >JSON</xref >.
647
+ An instance may be any valid JSON value as defined by <xref target =" RFC8259 " >JSON</xref >.
645
648
JSON Schema imposes no restrictions on type: JSON Schema can describe any JSON
646
649
value, including, for example, null.
647
650
</t >
667
670
</t >
668
671
</section >
669
672
673
+ <section title =" Regular Expressions" anchor =" regex" >
674
+ <t >
675
+ Keywords MAY use regular expressions to express constraints, or constrain
676
+ the instance value to be a regular expression.
677
+ These regular expressions SHOULD be valid according to the
678
+ <xref target =" ecma262" >ECMA 262</xref > regular expression dialect.
679
+ </t >
680
+ <t >
681
+ Furthermore, given the high disparity in regular expression constructs support,
682
+ schema authors SHOULD limit themselves to the following regular expression
683
+ tokens:
684
+
685
+ <list >
686
+ <t >individual Unicode characters, as defined by the <xref
687
+ target =" RFC8259" >JSON specification</xref >;</t >
688
+ <t >simple character classes ([abc]), range character classes ([a-z]);</t >
689
+ <t >complemented character classes ([^abc], [^a-z]);</t >
690
+ <t >simple quantifiers: "+" (one or more), "*" (zero or more), "?" (zero or
691
+ one), and their lazy versions ("+?", "*?", "??");</t >
692
+ <t >range quantifiers: "{x}" (exactly x occurrences), "{x,y}" (at least x, at
693
+ most y, occurrences), {x,} (x occurrences or more), and their lazy
694
+ versions;</t >
695
+ <t >the beginning-of-input ("^") and end-of-input ("$") anchors;</t >
696
+ <t >simple grouping ("(...)") and alternation ("|").</t >
697
+ </list >
698
+ </t >
699
+ <t >
700
+ Finally, implementations MUST NOT take regular expressions to be
701
+ anchored, neither at the beginning nor at the end. This means, for instance,
702
+ the pattern "es" matches "expression".
703
+ </t >
704
+ </section >
705
+
670
706
<section title =" Extending JSON Schema" >
671
707
<t >
672
708
Additional schema keywords and schema vocabularies MAY be defined
1095
1131
schemas is a concern.
1096
1132
1097
1133
Implementations MUST NOT take any other action based on the presence, absence,
1098
- or contents of "$comment" properties.
1134
+ or contents of "$comment" properties. In particular, the value of "$comment"
1135
+ MUST NOT be collected as an annotation result.
1099
1136
</t >
1100
1137
</section >
1101
1138
@@ -1626,7 +1663,7 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1626
1663
<section title =" Security Considerations" anchor =" security" >
1627
1664
<t >
1628
1665
Both schemas and instances are JSON values. As such, all security considerations
1629
- defined in <xref target =" RFC7159 " >RFC 7159 </xref > apply.
1666
+ defined in <xref target =" RFC8259 " >RFC 8259 </xref > apply.
1630
1667
</t >
1631
1668
<t >
1632
1669
Instances and schemas are both frequently written by untrusted third parties, to be
@@ -1667,16 +1704,17 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1667
1704
<t >
1668
1705
Encoding considerations: Encoding considerations are
1669
1706
identical to those specified for the "application/json"
1670
- media type. See <xref target =" RFC7159 " >JSON</xref >.
1707
+ media type. See <xref target =" RFC8259 " >JSON</xref >.
1671
1708
</t >
1672
1709
<t >
1673
1710
Security considerations: See Section
1674
1711
<xref target =" security" format =" counter" ></xref > above.
1675
1712
</t >
1676
1713
<t >
1677
1714
Interoperability considerations: See Sections
1678
- <xref target =" language" format =" counter" ></xref > and
1679
- <xref target =" integers" format =" counter" ></xref > above.
1715
+ <xref target =" language" format =" counter" ></xref >,
1716
+ <xref target =" integers" format =" counter" ></xref >, and
1717
+ <xref target =" regex" format =" counter" ></xref > above.
1680
1718
</t >
1681
1719
<t >
1682
1720
Fragment identifier considerations: See Section
@@ -1710,16 +1748,17 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1710
1748
<t >
1711
1749
Encoding considerations: Encoding considerations are
1712
1750
identical to those specified for the "application/json"
1713
- media type. See <xref target =" RFC7159 " >JSON</xref >.
1751
+ media type. See <xref target =" RFC8259 " >JSON</xref >.
1714
1752
</t >
1715
1753
<t >
1716
1754
Security considerations: See Section
1717
1755
<xref target =" security" format =" counter" ></xref > above.
1718
1756
</t >
1719
1757
<t >
1720
1758
Interoperability considerations: See Sections
1721
- <xref target =" language" format =" counter" ></xref > and
1722
- <xref target =" integers" format =" counter" ></xref > above.
1759
+ <xref target =" language" format =" counter" ></xref >,
1760
+ <xref target =" integers" format =" counter" ></xref >, and
1761
+ <xref target =" regex" format =" counter" ></xref > above.
1723
1762
</t >
1724
1763
<t >
1725
1764
Fragment identifier considerations: See Section
@@ -1738,8 +1777,16 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1738
1777
&RFC3986;
1739
1778
&RFC6839;
1740
1779
&RFC6901;
1741
- &RFC7159 ;
1780
+ &RFC8259 ;
1742
1781
&ldp;
1782
+ <reference anchor =" ecma262"
1783
+ target =" http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf" >
1784
+ <front >
1785
+ <title >ECMA 262 specification</title >
1786
+ <author />
1787
+ <date />
1788
+ </front >
1789
+ </reference >
1743
1790
</references >
1744
1791
1745
1792
<references title =" Informative References" >
@@ -1754,7 +1801,7 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1754
1801
<organization />
1755
1802
</author >
1756
1803
<author initials =" H." surname =" Andrews" >
1757
- <organization >Cloudflare, Inc.</ organization >
1804
+ <organization / >
1758
1805
</author >
1759
1806
<author initials =" G." surname =" Luff" >
1760
1807
<organization />
@@ -1767,7 +1814,7 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
1767
1814
<front >
1768
1815
<title >JSON Hyper-Schema: A Vocabulary for Hypermedia Annotation of JSON</title >
1769
1816
<author initials =" H." surname =" Andrews" >
1770
- <organization >Cloudflare, Inc.</ organization >
1817
+ <organization / >
1771
1818
</author >
1772
1819
<author initials =" A." surname =" Wright" >
1773
1820
<organization />
0 commit comments