@@ -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.
@@ -440,10 +438,8 @@ vocabularies MUST NOT define any keywords which begin with this prefix.
440
438
441
439
#### Handling of unrecognized or unsupported keywords {#unrecognized}
442
440
443
- Implementations SHOULD treat keywords they do not recognize, or that they
444
- recognize but do not support, as annotations, where the value of the keyword is
445
- the value of the annotation. Whether an implementation collects these
446
- annotations or not, they MUST otherwise ignore the keywords.
441
+ Implementations MUST refuse to evaluate schemas which contain keywords which
442
+ they do not know how to process or explicitly choose not to process.
447
443
448
444
## Keyword Behaviors
449
445
@@ -831,11 +827,6 @@ re-use. These keywords do not affect validation or annotation results. Their
831
827
purpose in the core vocabulary is to ensure that locations are available for
832
828
certain purposes and will not be redefined by extension keywords.
833
829
834
- While these keywords do not directly affect results, as explained in
835
- {{non-schemas}} unrecognized extension keywords that reserve locations for
836
- re-usable schemas may have undesirable interactions with references in certain
837
- circumstances.
838
-
839
830
### Loading Instance Data
840
831
841
832
While none of the vocabularies defined as part of this or the associated
@@ -1008,13 +999,7 @@ refuse to process that schema.
1008
999
1009
1000
Implementations that do not support a vocabulary that is optionally used by a
1010
1001
schema SHOULD proceed with processing the schema. The keywords will be
1011
- considered to be unrecognized keywords as addressed by {{unrecognized}}. Note
1012
- that since the recommended behavior for such keywords is to collect them as
1013
- annotations, vocabularies consisting only of annotations will have the same
1014
- behavior when used optionally whether the implementation supports them or not.
1015
- This allows annotation-only vocabularies to be supported without custom code,
1016
- even in implementations that do not support providing custom code for extension
1017
- vocabularies.
1002
+ considered to be unrecognized keywords as addressed by {{unrecognized}}.
1018
1003
1019
1004
##### Vocabularies are schema resource-scoped
1020
1005
@@ -1580,21 +1565,6 @@ that take one or more subschemas as a value. These keywords may be `$defs` and
1580
1565
the standard applicators from this document, or extension keywords from a known
1581
1566
vocabulary, or implementation-specific custom keywords.
1582
1567
1583
- Multi-level structures of unknown keywords are capable of introducing nested
1584
- subschemas, which would be subject to the processing rules for ` $id ` . Therefore,
1585
- having a reference target in such an unrecognized structure cannot be reliably
1586
- implemented, and the resulting behavior is undefined. Similarly, a reference
1587
- target under a known keyword, for which the value is known not to be a schema,
1588
- results in undefined behavior in order to avoid burdening implementations with
1589
- the need to detect such targets.[ ^ 10 ]
1590
-
1591
- [ ^ 10 ] : These scenarios are analogous to fetching a schema over HTTP but
1592
- receiving a response with a Content-Type other than ` application/schema+json ` .
1593
- An implementation can certainly try to interpret it as a schema, but the origin
1594
- server offered no guarantee that it actually is any such thing. Therefore,
1595
- interpreting it as such has security implication and may produce unpredictable
1596
- results.
1597
-
1598
1568
Note that single-level custom keywords with identical syntax and semantics to
1599
1569
` $defs ` do not allow for any intervening ` $id ` keywords, and therefore will
1600
1570
behave correctly under implementations that attempt to use any reference target
0 commit comments