Skip to content

Commit dc9e8a8

Browse files
authored
Merge pull request #987 from handrews/def-annot
Collect unknown keywords as annotations
2 parents 21e3042 + b8dc783 commit dc9e8a8

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

jsonschema-core.xml

+14-6
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@
151151
<t>
152152
JSON Schema can be extended either by defining additional vocabularies,
153153
or less formally by defining additional keywords outside of any vocabulary.
154-
Unrecognized individual keywords are ignored, while the behavior with respect
155-
to an unrecognized vocabulary can be controlled when declaring which
156-
vocabularies are in use.
154+
Unrecognized individual keywords simply have their values collected as annotations,
155+
while the behavior with respect to an unrecognized vocabulary can be controlled
156+
when declaring which vocabularies are in use.
157157
</t>
158158
<t>
159159
This document defines a core vocabulary that MUST be supported by any
@@ -354,7 +354,8 @@
354354
</t>
355355
<t>
356356
A JSON Schema MAY contain properties which are not schema keywords.
357-
Unknown keywords SHOULD be ignored.
357+
Unknown keywords SHOULD be treated as annotations, where the value
358+
of the keyword is the value of the annotation.
358359
</t>
359360
<t>
360361
An empty schema is a JSON Schema with no properties, or only unknown
@@ -578,7 +579,8 @@
578579
by any entity. Save for explicit agreement, schema authors SHALL NOT
579580
expect these additional keywords and vocabularies to be supported by
580581
implementations that do not explicitly document such support.
581-
Implementations SHOULD ignore keywords they do not support.
582+
Implementations SHOULD treat keywords they do not support as annotations,
583+
where the value of the keyword is the value of the annotation.
582584
</t>
583585
<t>
584586
Implementations MAY provide the ability to register or load handlers
@@ -1240,7 +1242,8 @@
12401242
</t>
12411243
<t>
12421244
Per <xref target="extending" format="counter"></xref>, unrecognized
1243-
keywords SHOULD be ignored. This remains the case for keywords defined
1245+
keywords SHOULD be treated as annotations.
1246+
This remains the case for keywords defined
12441247
by unrecognized vocabularies. It is not currently possible to distinguish
12451248
between unrecognized keywords that are defined in vocabularies from
12461249
those that are not part of any vocabulary.
@@ -3093,6 +3096,11 @@ https://example.com/schemas/common#/$defs/count/minimum
30933096
system resources.
30943097
Validators MUST NOT fall into an infinite loop.
30953098
</t>
3099+
<t>
3100+
A malicious party could cause an implementation to repeatedly collect a copy
3101+
of a very large value as an annotation. Implementations SHOULD guard against
3102+
excessive consumption of system resources in such a scenario.
3103+
</t>
30963104
<t>
30973105
Servers MUST ensure that malicious parties can't change the functionality of
30983106
existing schemas by uploading a schema with a pre-existing or very similar "$id".

0 commit comments

Comments
 (0)