@@ -1633,6 +1633,12 @@ results.
16331633
16341634#### Keywords for Applying Subschemas to Arrays
16351635
1636+ ##### Indexing Arrays {#array-index}
1637+
1638+ When working with arrays and indices, JSON Schema uses zero-based indexing. This
1639+ aligns with both JSON's JavaScript heritage and its usage of JSON Pointer for
1640+ references and annotations.
1641+
16361642##### ` prefixItems `
16371643
16381644The value of ` prefixItems ` MUST be a non-empty array of valid JSON Schemas.
@@ -1657,20 +1663,20 @@ The value of `items` MUST be a valid JSON Schema.
16571663This keyword ignores elements in the instance array equal to the number of
16581664subschemas found in the ` prefixItems ` array in the same schema object, starting
16591665from the beginning of the instance array. It then applies its subschema to
1660- remaining instance elements. If ` prefixItems ` does not exist within the same
1661- schema object, ` items ` applies its subschema to all instance array elements.
1666+ remaining elements.
1667+
1668+ If ` prefixItems ` contains more subschemas than the number of elements in the
1669+ instance array, ` items ` applies its subschema to no elements.
1670+
1671+ If ` prefixItems ` does not exist within the same schema object, ` items ` applies
1672+ its subschema to all elements.
16621673
16631674If the ` items ` subschema is applied to any positions within the instance array,
16641675it produces an annotation result of boolean true, indicating that all remaining
16651676array elements have been evaluated against this keyword's subschema.
16661677
16671678Omitting this keyword has the same assertion behavior as an empty schema.
16681679
1669- Implementations MAY choose to implement or optimize this keyword in another way
1670- that produces the same effect, such as by directly checking for the presence and
1671- size of a ` prefixItems ` array. Implementations that do not support annotation
1672- collection MUST do so.
1673-
16741680The presence of this keyword affects the behavior of
16751681[ ` unevaluatedItems ` ] ( #unevaluateditems ) .
16761682
@@ -1712,7 +1718,8 @@ The annotation result of this keyword is the set of instance property names
17121718matched by at least one property under this keyword.
17131719
17141720The presence of this keyword affects the behaviors of
1715- [ ` additionalProperties ` (#additionalproperties) and [ ` unevaluatedProperties ` ] ( #unevaluatedproperties ) .
1721+ [ ` additionalProperties ` (#additionalproperties) and
1722+ [ ` unevaluatedProperties ` ] ( #unevaluatedproperties ) .
17161723
17171724##### ` additionalProperties ` {#additionalproperties}
17181725
@@ -1789,12 +1796,12 @@ The minimum number of occurrences is provided by the `minContains` keyword
17891796within the same schema object as ` contains ` . If ` minContains ` is absent, the
17901797minimum number of occurrences MUST be 1.
17911798
1792- This keyword produces an annotation value which is an array of the indices for
1793- which this keyword validates successfully when applying its subschema, in
1794- ascending order. The value MAY be a boolean ` true ` if the subschema validates
1795- successfully when applied to every index of the instance. The annotation MUST be
1796- present if the instance array to which this keyword's schema applies
1797- is empty.
1799+ This keyword produces an annotation value which is an array of the zero-based
1800+ indices for which this keyword validates successfully when applying its
1801+ subschema, in ascending order. The value MAY be a boolean ` true ` if the
1802+ subschema validates successfully when applied to every index of the instance.
1803+ The annotation MUST be present if the instance array to which this keyword's
1804+ schema applies is empty.
17981805
17991806The presence of this keyword affects the behavior of
18001807[ ` unevaluatedItems ` ] ( #unevaluateditems ) .
0 commit comments