Skip to content

Commit 7e40945

Browse files
authored
Merge branch 'master' into referenced
2 parents a6af98a + 559e095 commit 7e40945

6 files changed

+166
-127
lines changed

hyper-schema.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,18 @@
4343
"properties": {
4444
"additionalProperties": { "$ref": "#" }
4545
},
46-
"if": {"$ref": "#"},
47-
"then": {"$ref": "#"},
48-
"else": {"$ref": "#"},
46+
"if": { "$ref": "#" },
47+
"then": { "$ref": "#" },
48+
"else": { "$ref": "#" },
4949
"allOf": { "$ref": "#/$defs/schemaArray" },
5050
"anyOf": { "$ref": "#/$defs/schemaArray" },
5151
"oneOf": { "$ref": "#/$defs/schemaArray" },
5252
"not": { "$ref": "#" },
5353
"contains": { "$ref": "#" },
54-
"propertyNames": { "$ref": "#" },
55-
54+
"propertyNames": {
55+
"type": "object",
56+
"additionalProperties": { "$ref": "#" }
57+
},
5658
"base": {
5759
"type": "string",
5860
"format": "uri-template"

jsonschema-core.xml

+104-57
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!ENTITY RFC6839 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6839.xml">
66
<!ENTITY RFC6901 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6901.xml">
77
<!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">
99
<!ENTITY RFC7231 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7231.xml">
1010
<!ENTITY RFC8288 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8288.xml">
1111
<!ENTITY ldp SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml4/reference.W3C.REC-ldp-20150226.xml">
@@ -30,7 +30,6 @@
3030
</author>
3131

3232
<author fullname="Henry Andrews" initials="H" surname="Andrews" role="editor">
33-
<organization>Cloudflare, Inc.</organization>
3433
<address>
3534
<postal>
3635
<street></street>
@@ -108,7 +107,7 @@
108107
<t>
109108
The terms "JSON", "JSON text", "JSON value", "member", "element", "object", "array",
110109
"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>.
112111
</t>
113112
</section>
114113

@@ -132,6 +131,13 @@
132131
Applicators apply subschemas to parts of the instance and combine
133132
their results.
134133
</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>
135141
<t>
136142
Evaluating an instance against a schema involves processing all of the
137143
keywords in the schema against the appropriate locations within the instance.
@@ -146,48 +152,45 @@
146152
subschemas have been evaluated, although in some circumstance evaluation
147153
may be short-circuited due to assertion results.
148154
</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>
191194
<section title="Applicators" anchor="applicators">
192195
<t>
193196
Applicators allow for building more complex schemas than can be accomplished
@@ -641,7 +644,7 @@
641644

642645
<section title="Range of JSON Values">
643646
<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>.
645648
JSON Schema imposes no restrictions on type: JSON Schema can describe any JSON
646649
value, including, for example, null.
647650
</t>
@@ -667,6 +670,39 @@
667670
</t>
668671
</section>
669672

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+
670706
<section title="Extending JSON Schema">
671707
<t>
672708
Additional schema keywords and schema vocabularies MAY be defined
@@ -1095,7 +1131,8 @@
10951131
schemas is a concern.
10961132

10971133
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.
10991136
</t>
11001137
</section>
11011138

@@ -1626,7 +1663,7 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
16261663
<section title="Security Considerations" anchor="security">
16271664
<t>
16281665
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.
16301667
</t>
16311668
<t>
16321669
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
16671704
<t>
16681705
Encoding considerations: Encoding considerations are
16691706
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>.
16711708
</t>
16721709
<t>
16731710
Security considerations: See Section
16741711
<xref target="security" format="counter"></xref> above.
16751712
</t>
16761713
<t>
16771714
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.
16801718
</t>
16811719
<t>
16821720
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
17101748
<t>
17111749
Encoding considerations: Encoding considerations are
17121750
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>.
17141752
</t>
17151753
<t>
17161754
Security considerations: See Section
17171755
<xref target="security" format="counter"></xref> above.
17181756
</t>
17191757
<t>
17201758
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.
17231762
</t>
17241763
<t>
17251764
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
17381777
&RFC3986;
17391778
&RFC6839;
17401779
&RFC6901;
1741-
&RFC7159;
1780+
&RFC8259;
17421781
&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>
17431790
</references>
17441791

17451792
<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
17541801
<organization/>
17551802
</author>
17561803
<author initials="H." surname="Andrews">
1757-
<organization>Cloudflare, Inc.</organization>
1804+
<organization/>
17581805
</author>
17591806
<author initials="G." surname="Luff">
17601807
<organization/>
@@ -1767,7 +1814,7 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
17671814
<front>
17681815
<title>JSON Hyper-Schema: A Vocabulary for Hypermedia Annotation of JSON</title>
17691816
<author initials="H." surname="Andrews">
1770-
<organization>Cloudflare, Inc.</organization>
1817+
<organization/>
17711818
</author>
17721819
<author initials="A." surname="Wright">
17731820
<organization/>

0 commit comments

Comments
 (0)