@@ -67,9 +67,7 @@ identified in a meta-schema.
67
67
68
68
JSON Schema can be extended either by defining additional vocabularies, or less
69
69
formally by defining additional keywords outside of any vocabulary. Unrecognized
70
- individual keywords simply have their values collected as annotations, while the
71
- behavior with respect to an unrecognized vocabulary can be controlled when
72
- declaring which vocabularies are in use.
70
+ individual keywords are not supported.
73
71
74
72
This document defines a core vocabulary that MUST be supported by any
75
73
implementation, and cannot be disabled. Its keywords are each prefixed with a
@@ -216,8 +214,8 @@ adjacent keywords.
216
214
Extension keywords, meaning those defined outside of this document and its
217
215
companions, are free to define other behaviors as well.
218
216
219
- A JSON Schema MAY contain properties which are not schema keywords or are not
220
- recognized as schema keywords. The behavior of such keywords is governed by
217
+ A JSON Schema MUST NOT contain properties which are not schema keywords or are
218
+ not recognized as schema keywords. The behavior of such keywords is governed by
221
219
{{unrecognized}}.
222
220
223
221
An empty schema is a JSON Schema with no properties.
@@ -436,10 +434,8 @@ vocabularies MUST NOT define any keywords which begin with this prefix.
436
434
437
435
#### Handling of unrecognized or unsupported keywords {#unrecognized}
438
436
439
- Implementations SHOULD treat keywords they do not recognize, or that they
440
- recognize but do not support, as annotations, where the value of the keyword is
441
- the value of the annotation. Whether an implementation collects these
442
- annotations or not, they MUST otherwise ignore the keywords.
437
+ Implementations MUST refuse to process schemas which contain keywords they do
438
+ not recognize, or that they recognize but do not support.
443
439
444
440
## Keyword Behaviors
445
441
@@ -809,11 +805,6 @@ re-use. These keywords do not affect validation or annotation results. Their
809
805
purpose in the core vocabulary is to ensure that locations are available for
810
806
certain purposes and will not be redefined by extension keywords.
811
807
812
- While these keywords do not directly affect results, as explained in
813
- {{non-schemas}} unrecognized extension keywords that reserve locations for
814
- re-usable schemas may have undesirable interactions with references in certain
815
- circumstances.
816
-
817
808
### Loading Instance Data
818
809
819
810
While none of the vocabularies defined as part of this or the associated
@@ -986,13 +977,7 @@ refuse to process that schema.
986
977
987
978
Implementations that do not support a vocabulary that is optionally used by a
988
979
schema SHOULD proceed with processing the schema. The keywords will be
989
- considered to be unrecognized keywords as addressed by {{unrecognized}}. Note
990
- that since the recommended behavior for such keywords is to collect them as
991
- annotations, vocabularies consisting only of annotations will have the same
992
- behavior when used optionally whether the implementation supports them or not.
993
- This allows annotation-only vocabularies to be supported without custom code,
994
- even in implementations that do not support providing custom code for extension
995
- vocabularies.
980
+ considered to be unrecognized keywords as addressed by {{unrecognized}}.
996
981
997
982
##### Vocabularies are schema resource-scoped
998
983
@@ -1558,21 +1543,6 @@ that take one or more subschemas as a value. These keywords may be `$defs` and
1558
1543
the standard applicators from this document, or extension keywords from a known
1559
1544
vocabulary, or implementation-specific custom keywords.
1560
1545
1561
- Multi-level structures of unknown keywords are capable of introducing nested
1562
- subschemas, which would be subject to the processing rules for ` $id ` . Therefore,
1563
- having a reference target in such an unrecognized structure cannot be reliably
1564
- implemented, and the resulting behavior is undefined. Similarly, a reference
1565
- target under a known keyword, for which the value is known not to be a schema,
1566
- results in undefined behavior in order to avoid burdening implementations with
1567
- the need to detect such targets.[ ^ 10 ]
1568
-
1569
- [ ^ 10 ] : These scenarios are analogous to fetching a schema over HTTP but
1570
- receiving a response with a Content-Type other than ` application/schema+json ` .
1571
- An implementation can certainly try to interpret it as a schema, but the origin
1572
- server offered no guarantee that it actually is any such thing. Therefore,
1573
- interpreting it as such has security implication and may produce unpredictable
1574
- results.
1575
-
1576
1546
Note that single-level custom keywords with identical syntax and semantics to
1577
1547
` $defs ` do not allow for any intervening ` $id ` keywords, and therefore will
1578
1548
behave correctly under implementations that attempt to use any reference target
0 commit comments