@@ -1774,7 +1774,7 @@ keyword's annotation causes `contains` to assume a minimum value of 1.
1774
1774
1775
1775
The value of this keyword MUST be a valid JSON Schema.
1776
1776
1777
- This keyword applies its subschema to array elements.
1777
+ This keyword applies to array instances by applying its subschema to the array's elements.
1778
1778
1779
1779
An instance is valid against ` contains ` if the number of elements that are valid
1780
1780
against its subschema is with the inclusive range of the minimum and (if any)
@@ -1788,22 +1788,24 @@ The minimum number of occurrences is provided by the `minContains` keyword
1788
1788
within the same schema object as ` contains ` . If ` minContains ` is absent, the
1789
1789
minimum number of occurrences MUST be 1.
1790
1790
1791
- Implementations MAY implement the dependency on ` minContains ` and ` maxContains `
1792
- by inspecting their values rather than reading annotations produced by those
1793
- keywords.
1794
-
1795
- This keyword produces an annotation value which is an array of the indexes to
1791
+ This keyword produces an annotation value which is an array of the indices for
1796
1792
which this keyword validates successfully when applying its subschema, in
1797
1793
ascending order. The value MAY be a boolean ` true ` if the subschema validates
1798
1794
successfully when applied to every index of the instance. The annotation MUST be
1799
1795
present if the instance array to which this keyword's schema applies
1800
1796
is empty.
1801
1797
1802
- This annotation affects the behavior of ` unevaluatedItems ` .
1798
+ The presence of this keyword affects the behavior of
1799
+ [ ` unevaluatedItems ` ] ( #unevaluateditems ) .
1800
+
1801
+ Under most circumstances, the ` contains ` subschema MAY be short-circuited.
1802
+ However, for the following cases, the ` contains ` subschema MUST be applied to
1803
+ every array element.
1803
1804
1804
- The subschema MUST be applied to every array element even after the first match
1805
- has been found, in order to collect annotations for use by other keywords. This
1806
- is to ensure that all possible annotations are collected.
1805
+ - If ` unevaluatedItems ` appears in any subschema in the dynamic scope that
1806
+ applies to the same instance location, to ensure that all evaluated items are
1807
+ accounted for.
1808
+ - When collecting annotations, to ensure that all annotations are found.
1807
1809
1808
1810
## Keywords for Unevaluated Locations
1809
1811
@@ -1821,16 +1823,15 @@ If an item in an array or an object property is "successfully evaluated", it is
1821
1823
logically considered to be valid in terms of the representation of the object or
1822
1824
array that's expected. For example if a subschema represents a car, which
1823
1825
requires between 2-4 wheels, and the value of "wheels" is 6, the instance object
1824
- is not "evaluated" to be a car, and the "wheels" property is considered
1825
- "unevaluated (successfully as a known thing)", and does not retain any
1826
- annotations.
1826
+ is not "evaluated" to be a car, and thus the "wheels" property is considered
1827
+ "unevaluated".
1827
1828
1828
1829
Recall that adjacent keywords are keywords within the same schema object, and
1829
1830
that the dynamic-scope subschemas include reference targets as well as lexical
1830
1831
subschemas.
1831
1832
1832
- The behavior of these keywords depend on the annotation results of adjacent
1833
- keywords that apply to the instance location being validated .
1833
+ The behaviors of these keywords depend on adjacent keywords as well as any
1834
+ keywords in subschemas that apply to the instance location being evaluated .
1834
1835
1835
1836
### Keyword Independence
1836
1837
0 commit comments