From f1422a02e216afcd60b87c68c58e077d266cdfe5 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Sat, 12 Oct 2024 18:35:07 +1300 Subject: [PATCH 01/10] update unevaluated* dependency sections to remove notions of annotation control --- jsonschema-core.md | 64 +++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 37 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index d3c7963b..ba2ec9be 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1645,27 +1645,23 @@ and the instance value are affected by this keyword. This keyword produces an annotation value which is the largest index to which this keyword applied a subschema. The value MAY be a boolean true if a subschema was applied to every index of the instance, such as is produced by the `items` -keyword. This annotation affects the behavior of `items` and `unevaluatedItems`. +keyword. + +The presence of this keyword affects the behaviors of [`items`](#items) and +[`unevaluatedItems`](#unevaluateditems). ##### `items` {#items} The value of `items` MUST be a valid JSON Schema. -This keyword applies its subschema to all instance elements at indexes greater -than the length of the `prefixItems` array in the same schema object, as -reported by the annotation result of that `prefixItems` keyword. If no such -annotation result exists, `items` applies its subschema to all instance array -elements.[^11] - -[^11]: Note that the behavior of `items` without `prefixItems` is identical to -that of the schema form of `items` in prior drafts. When `prefixItems` is -present, the behavior of `items` is identical to the former `additionalItems` -keyword. +This keyword applies its subschema to all instance elements at indices greater +than the length of the `prefixItems` array in the same schema object. If +`prefixItems` does not exist within the same schema object, `items` applies its +subschema to all instance array elements. If the `items` subschema is applied to any positions within the instance array, it produces an annotation result of boolean true, indicating that all remaining -array elements have been evaluated against this keyword's subschema. This -annotation affects the behavior of `unevaluatedItems`. +array elements have been evaluated against this keyword's subschema. Omitting this keyword has the same assertion behavior as an empty schema. @@ -1674,6 +1670,9 @@ that produces the same effect, such as by directly checking for the presence and size of a `prefixItems` array. Implementations that do not support annotation collection MUST do so. +The presence of this keyword affects the behavior of +[`unevaluatedItems`](#unevaluateditems). + #### Keywords for Applying Subschemas to Objects ##### `properties` @@ -1685,11 +1684,13 @@ Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value, the child instance for that name successfully validates against the corresponding schema. +Omitting this keyword has the same assertion behavior as an empty object. + The annotation result of this keyword is the set of instance property names -which are also present under this keyword. This annotation affects the behavior -of `additionalProperties` and `unevaluatedProperties`. +which are also present under this keyword. -Omitting this keyword has the same assertion behavior as an empty object. +The presence of this keyword affects the behavior of +[`additionalProperties`(#additionalProperties) and [`unevaluatedProperties`](#unevaluatedproperties). ##### `patternProperties` @@ -1704,11 +1705,13 @@ instance for that name successfully validates against each schema that corresponds to a matching regular expression. Recall: regular expressions are not implicitly anchored. +Omitting this keyword has the same assertion behavior as an empty object. + The annotation result of this keyword is the set of instance property names -matched by at least one property under this keyword. This annotation affects the -behavior of `additionalProperties` and `unevaluatedProperties`. +matched by at least one property under this keyword. -Omitting this keyword has the same assertion behavior as an empty object. +The presence of this keyword affects the behavior of +[`additionalProperties`(#additionalproperties) and [`unevaluatedProperties`](#unevaluatedproperties). ##### `additionalProperties` {#additionalproperties} @@ -1723,26 +1726,13 @@ that do not appear in the annotation results of either `properties` or For all such properties, validation succeeds if the child instance validates against the `additionalProperties` schema. -The annotation result of this keyword is the set of instance property names -validated by this keyword's subschema. This annotation affects the behavior of -`unevaluatedProperties`. - Omitting this keyword has the same assertion behavior as an empty schema. -Implementations MAY choose to implement or optimize this keyword in another way -that produces the same effect, such as by directly checking the names in -`properties` and the patterns in `patternProperties` against the instance -property set. Implementations that do not support annotation collection MUST do -so.[^12] - -[^12]: In defining this option, it seems there is the potential for ambiguity in -the output format. The ambiguity does not affect validation results, but it does -affect the resulting output format. The ambiguity allows for multiple valid -output results depending on whether annotations are used or a solution that -"produces the same effect" as draft-07. It is understood that annotations from -failing schemas are dropped. See our [Decision -Record](https://github.com/json-schema-org/json-schema-spec/tree/HEAD/adr/2022-04-08-cref-for-ambiguity-and-fix-later-gh-spec-issue-1172.md) -for further details. +The annotation result of this keyword is the set of instance property names +validated by this keyword's subschema. + +The presence of this keyword affects the behavior of +[`unevaluatedProperties`](#unevaluatedproperties). ##### `propertyNames` From 1b620aacb5f28f6c6aec41348eac8c3715f38320 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Sat, 12 Oct 2024 19:08:22 +1300 Subject: [PATCH 02/10] addressing annotation requirements in `contains` --- jsonschema-core.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index ba2ec9be..6f305bf3 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1774,7 +1774,7 @@ keyword's annotation causes `contains` to assume a minimum value of 1. The value of this keyword MUST be a valid JSON Schema. -This keyword applies its subschema to array elements. +This keyword applies to array instances by applying its subschema to the array's elements. An instance is valid against `contains` if the number of elements that are valid 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 within the same schema object as `contains`. If `minContains` is absent, the minimum number of occurrences MUST be 1. -Implementations MAY implement the dependency on `minContains` and `maxContains` -by inspecting their values rather than reading annotations produced by those -keywords. - -This keyword produces an annotation value which is an array of the indexes to +This keyword produces an annotation value which is an array of the indices for which this keyword validates successfully when applying its subschema, in ascending order. The value MAY be a boolean `true` if the subschema validates successfully when applied to every index of the instance. The annotation MUST be present if the instance array to which this keyword's schema applies is empty. -This annotation affects the behavior of `unevaluatedItems`. +The presence of this keyword affects the behavior of +[`unevaluatedItems`](#unevaluateditems). + +Under most circumstances, the `contains` subschema MAY be short-circuited. +However, for the following cases, the `contains` subschema MUST be applied to +every array element. -The subschema MUST be applied to every array element even after the first match -has been found, in order to collect annotations for use by other keywords. This -is to ensure that all possible annotations are collected. +- If `unevaluatedItems` appears in any subschema in the dynamic scope that + applies to the same instance location, to ensure that all evaluated items are + accounted for. +- When collecting annotations, to ensure that all annotations are found. ## Keywords for Unevaluated Locations @@ -1821,16 +1823,15 @@ If an item in an array or an object property is "successfully evaluated", it is logically considered to be valid in terms of the representation of the object or array that's expected. For example if a subschema represents a car, which requires between 2-4 wheels, and the value of "wheels" is 6, the instance object -is not "evaluated" to be a car, and the "wheels" property is considered -"unevaluated (successfully as a known thing)", and does not retain any -annotations. +is not "evaluated" to be a car, and thus the "wheels" property is considered +"unevaluated". Recall that adjacent keywords are keywords within the same schema object, and that the dynamic-scope subschemas include reference targets as well as lexical subschemas. -The behavior of these keywords depend on the annotation results of adjacent -keywords that apply to the instance location being validated. +The behaviors of these keywords depend on adjacent keywords as well as any +keywords in subschemas that apply to the instance location being evaluated. ### Keyword Independence From 0eb1821f0456a38758cf868e0bb53477a6fd248b Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Sat, 12 Oct 2024 19:46:36 +1300 Subject: [PATCH 03/10] update unevaluatedItems to remove annotation references --- jsonschema-core.md | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 6f305bf3..90c4a6db 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1774,7 +1774,8 @@ keyword's annotation causes `contains` to assume a minimum value of 1. The value of this keyword MUST be a valid JSON Schema. -This keyword applies to array instances by applying its subschema to the array's elements. +This keyword applies to array instances by applying its subschema to the array's +elements. An instance is valid against `contains` if the number of elements that are valid against its subschema is with the inclusive range of the minimum and (if any) @@ -1807,7 +1808,7 @@ every array element. accounted for. - When collecting annotations, to ensure that all annotations are found. -## Keywords for Unevaluated Locations +## Keywords for Unevaluated Locations {#unevaluated} The purpose of these keywords is to enable schema authors to apply subschemas to array items or object properties that have not been successfully evaluated @@ -1831,7 +1832,8 @@ that the dynamic-scope subschemas include reference targets as well as lexical subschemas. The behaviors of these keywords depend on adjacent keywords as well as any -keywords in subschemas that apply to the instance location being evaluated. +keywords in successfully validated subschemas that apply to the same instance +location. ### Keyword Independence @@ -1847,30 +1849,24 @@ outcomes. However, these keywords are notable exceptions: The value of `unevaluatedItems` MUST be a valid JSON Schema. -The behavior of this keyword depends on the annotation results of adjacent -keywords that apply to the instance location being validated. Specifically, the -annotations from `prefixItems`, `items`, and `contains`, which can come from -those keywords when they are adjacent to the `unevaluatedItems` keyword. Those -three annotations, as well as `unevaluatedItems`, can also result from any and -all adjacent [in-place applicator](#in-place) keywords. This includes but is not -limited to the in-place applicators defined in this document. - -If no relevant annotations are present, the `unevaluatedItems` subschema MUST be -applied to all locations in the array. If a boolean true value is present from -any of the relevant annotations, `unevaluatedItems` MUST be ignored. Otherwise, -the subschema MUST be applied to any index greater than the largest annotation -value for `prefixItems`, which does not appear in any annotation value for -`contains`. - -This means that `prefixItems`, `items`, `contains`, and all in-place applicators -MUST be evaluated before this keyword can be evaluated. Authors of extension -keywords MUST NOT define an in-place applicator that would need to be evaluated -after this keyword. +This keyword applies to array instances by applying its subschema to the array's +elements. + +The behavior of this keyword depends on all adjacent keywords as well as +keywords in successfully validated subschemas that apply to the same instance +location by evaluating the instance's elements. This includes, but is not +limited to, `prefixItems`, `items`, and `contains`, itself, and all +[in-place applicators](#in-place) defined in this document. + +This keyword applies its subschema to any array elements which have not been +deemed "evaluated" by other keywords per {#unevaluated}. Validation passes if +the keyword's subschema validates against all applicable array elements. If the `unevaluatedItems` subschema is applied to any positions within the instance array, it produces an annotation result of boolean true, analogous to -the behavior of `items`. This annotation affects the behavior of -`unevaluatedItems` in parent schemas. +the behavior of `items`. + +The presence of this keyword affects the behavior of other `unevaluatedItems` keywords found earlier in the dynamic scope that apply to the same instance location. Omitting this keyword has the same assertion behavior as an empty schema. From 589fb9340462dd3fe9f6c7ea8a1d101fe6b97f61 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Sat, 12 Oct 2024 19:56:37 +1300 Subject: [PATCH 04/10] copy unevaluatedItems wording to unevaluatedProperties --- jsonschema-core.md | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 90c4a6db..0f774405 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1859,14 +1859,16 @@ limited to, `prefixItems`, `items`, and `contains`, itself, and all [in-place applicators](#in-place) defined in this document. This keyword applies its subschema to any array elements which have not been -deemed "evaluated" by other keywords per {#unevaluated}. Validation passes if +deemed "evaluated" by other keywords per {{#unevaluated}}. Validation passes if the keyword's subschema validates against all applicable array elements. If the `unevaluatedItems` subschema is applied to any positions within the instance array, it produces an annotation result of boolean true, analogous to the behavior of `items`. -The presence of this keyword affects the behavior of other `unevaluatedItems` keywords found earlier in the dynamic scope that apply to the same instance location. +The presence of this keyword affects the behavior of other `unevaluatedItems` +keywords found earlier in the dynamic scope that apply to the same instance +location. Omitting this keyword has the same assertion behavior as an empty schema. @@ -1874,31 +1876,23 @@ Omitting this keyword has the same assertion behavior as an empty schema. The value of `unevaluatedProperties` MUST be a valid JSON Schema. -The behavior of this keyword depends on the annotation results of adjacent -keywords that apply to the instance location being validated. Specifically, the -annotations from `properties`, `patternProperties`, and `additionalProperties`, -which can come from those keywords when they are adjacent to the -`unevaluatedProperties` keyword. Those four annotations, as well as -`unevaluatedProperties`, can also result from any and all adjacent [in-place -applicator](#in-place) keywords. This includes but is not limited to the -in-place applicators defined in this document. - -Validation with `unevaluatedProperties` applies only to the child values of -instance names that do not appear in the `properties`, `patternProperties`, -`additionalProperties`, or `unevaluatedProperties` annotation results that apply -to the instance location being validated. +This keyword applies to object instances by applying its subschema to the object's +property values. -For all such properties, validation succeeds if the child instance validates -against the `unevaluatedProperties` schema. +The behavior of this keyword depends on all adjacent keywords as well as +keywords in successfully validated subschemas that apply to the same instance +location by evaluating the instance's property values. This includes, but is not limited +to, `properties`, `patternProperties`, and `additionalProperties`, itself, and +all [in-place applicators](#in-place) defined in this document. -This means that `properties`, `patternProperties`, `additionalProperties`, and -all in-place applicators MUST be evaluated before this keyword can be evaluated. -Authors of extension keywords MUST NOT define an in-place applicator that would -need to be evaluated after this keyword. +This keyword applies its subschema to any property values which have not benn deemed "evaluated" by other keywords per {{#unevaluated}}. Validation passes if the keyword's subschema validates against all applicable property values. The annotation result of this keyword is the set of instance property names -validated by this keyword's subschema. This annotation affects the behavior of -`unevaluatedProperties` in parent schemas. +validated by this keyword's subschema. + +The presence of this keyword affects the behavior of other `unevaluatedProperty` +keywords found earlier in the dynamic scope that apply to the same instance +location. Omitting this keyword has the same assertion behavior as an empty schema. From a49f09591b570312ddca46c15ab9831f97fd739a Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Sat, 12 Oct 2024 20:32:36 +1300 Subject: [PATCH 05/10] remove annotation dependency from additional properties --- jsonschema-core.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 0f774405..e98902b4 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1717,11 +1717,10 @@ The presence of this keyword affects the behavior of The value of `additionalProperties` MUST be a valid JSON Schema. -The behavior of this keyword depends on the presence and annotation results of -`properties` and `patternProperties` within the same schema object. Validation -with `additionalProperties` applies only to the child values of instance names -that do not appear in the annotation results of either `properties` or -`patternProperties`. +The behavior of this keyword depends on the presence of `properties` and +`patternProperties` within the same schema object. Validation with +`additionalProperties` applies only to the property values for which neither +`properties` nor `patternProperties` apply. For all such properties, validation succeeds if the child instance validates against the `additionalProperties` schema. From 4316cdf619df6a955d2d67bd3a9371af64c78838 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Mon, 14 Oct 2024 07:38:48 +1300 Subject: [PATCH 06/10] a bit of cleanup; hard-wrap missed line --- jsonschema-core.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index e98902b4..5ea04e5c 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1689,7 +1689,7 @@ Omitting this keyword has the same assertion behavior as an empty object. The annotation result of this keyword is the set of instance property names which are also present under this keyword. -The presence of this keyword affects the behavior of +The presence of this keyword affects the behaviors of [`additionalProperties`(#additionalProperties) and [`unevaluatedProperties`](#unevaluatedproperties). ##### `patternProperties` @@ -1710,7 +1710,7 @@ Omitting this keyword has the same assertion behavior as an empty object. The annotation result of this keyword is the set of instance property names matched by at least one property under this keyword. -The presence of this keyword affects the behavior of +The presence of this keyword affects the behaviors of [`additionalProperties`(#additionalproperties) and [`unevaluatedProperties`](#unevaluatedproperties). ##### `additionalProperties` {#additionalproperties} @@ -1858,8 +1858,8 @@ limited to, `prefixItems`, `items`, and `contains`, itself, and all [in-place applicators](#in-place) defined in this document. This keyword applies its subschema to any array elements which have not been -deemed "evaluated" by other keywords per {{#unevaluated}}. Validation passes if -the keyword's subschema validates against all applicable array elements. +deemed "evaluated" per {{#unevaluated}}. Validation passes if the keyword's +subschema validates against all applicable array elements. If the `unevaluatedItems` subschema is applied to any positions within the instance array, it produces an annotation result of boolean true, analogous to @@ -1884,7 +1884,9 @@ location by evaluating the instance's property values. This includes, but is not to, `properties`, `patternProperties`, and `additionalProperties`, itself, and all [in-place applicators](#in-place) defined in this document. -This keyword applies its subschema to any property values which have not benn deemed "evaluated" by other keywords per {{#unevaluated}}. Validation passes if the keyword's subschema validates against all applicable property values. +This keyword applies its subschema to any property values which have not been +deemed "evaluated" per {{#unevaluated}}. Validation passes if the keyword's +subschema validates against all applicable property values. The annotation result of this keyword is the set of instance property names validated by this keyword's subschema. From 78719208e3ce1110e6881386bb7edabae92a991b Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 15 Oct 2024 10:51:58 +1300 Subject: [PATCH 07/10] Update jsonschema-core.md Co-authored-by: Karen Etheridge --- jsonschema-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 5ea04e5c..14c04023 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1891,7 +1891,7 @@ subschema validates against all applicable property values. The annotation result of this keyword is the set of instance property names validated by this keyword's subschema. -The presence of this keyword affects the behavior of other `unevaluatedProperty` +The presence of this keyword affects the behavior of other `unevaluatedProperties` keywords found earlier in the dynamic scope that apply to the same instance location. From 23147956183162fb689ab6b58d808c573dd68340 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 18 Oct 2024 21:40:24 +1300 Subject: [PATCH 08/10] fix section link format --- jsonschema-core.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 14c04023..eebb910d 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1858,7 +1858,7 @@ limited to, `prefixItems`, `items`, and `contains`, itself, and all [in-place applicators](#in-place) defined in this document. This keyword applies its subschema to any array elements which have not been -deemed "evaluated" per {{#unevaluated}}. Validation passes if the keyword's +deemed "evaluated" per {{unevaluated}}. Validation passes if the keyword's subschema validates against all applicable array elements. If the `unevaluatedItems` subschema is applied to any positions within the @@ -1885,7 +1885,7 @@ to, `properties`, `patternProperties`, and `additionalProperties`, itself, and all [in-place applicators](#in-place) defined in this document. This keyword applies its subschema to any property values which have not been -deemed "evaluated" per {{#unevaluated}}. Validation passes if the keyword's +deemed "evaluated" per {{unevaluated}}. Validation passes if the keyword's subschema validates against all applicable property values. The annotation result of this keyword is the set of instance property names From c4953f1bf7f590209db92d6085ec4f8813cef332 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 25 Oct 2024 20:47:24 +1300 Subject: [PATCH 09/10] removed mention of indices from items; fix type in contains --- jsonschema-core.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index eebb910d..e7fc6493 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1654,10 +1654,11 @@ The presence of this keyword affects the behaviors of [`items`](#items) and The value of `items` MUST be a valid JSON Schema. -This keyword applies its subschema to all instance elements at indices greater -than the length of the `prefixItems` array in the same schema object. If -`prefixItems` does not exist within the same schema object, `items` applies its -subschema to all instance array elements. +This keyword ignores elements in the instance array equal to the number of +subschemas found in the `prefixItems` array in the same schema object, starting +from the beginning of the instance array. It then applies its subschema to +remaining instance elements. If `prefixItems` does not exist within the same +schema object, `items` applies its subschema to all instance array elements. If the `items` subschema is applied to any positions within the instance array, it produces an annotation result of boolean true, indicating that all remaining @@ -1766,10 +1767,10 @@ Validation MUST always succeed against this keyword. The value of this keyword is used as its annotation result. Per {{default-behaviors}}, omitted keywords MUST NOT produce annotation results. -However, as described in the section for `contains`, the absence of this -keyword's annotation causes `contains` to assume a minimum value of 1. +However, as described in {{contains}}, the absence of this keyword's annotation +causes `contains` to assume a minimum value of 1. -##### `contains` +##### `contains` {#contains} The value of this keyword MUST be a valid JSON Schema. @@ -1777,7 +1778,7 @@ This keyword applies to array instances by applying its subschema to the array's elements. An instance is valid against `contains` if the number of elements that are valid -against its subschema is with the inclusive range of the minimum and (if any) +against its subschema is within the inclusive range of the minimum and (if any) maximum number of occurrences. The maximum number of occurrences is provided by the `maxContains` keyword From a8032298c8a96e7a5636bdddac0dafe06a7668ff Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Sat, 26 Oct 2024 15:07:16 +1300 Subject: [PATCH 10/10] added section about array indexing --- jsonschema-core.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index e7fc6493..3c10e241 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -1633,6 +1633,12 @@ results. #### Keywords for Applying Subschemas to Arrays +##### Indexing Arrays {#array-index} + +When working with arrays and indices, JSON Schema uses zero-based indexing. This +aligns with both JSON's JavaScript heritage and its usage of JSON Pointer for +references and annotations. + ##### `prefixItems` The value of `prefixItems` MUST be a non-empty array of valid JSON Schemas. @@ -1657,8 +1663,13 @@ The value of `items` MUST be a valid JSON Schema. This keyword ignores elements in the instance array equal to the number of subschemas found in the `prefixItems` array in the same schema object, starting from the beginning of the instance array. It then applies its subschema to -remaining instance elements. If `prefixItems` does not exist within the same -schema object, `items` applies its subschema to all instance array elements. +remaining elements. + +If `prefixItems` contains more subschemas than the number of elements in the +instance array, `items` applies its subschema to no elements. + +If `prefixItems` does not exist within the same schema object, `items` applies +its subschema to all elements. If the `items` subschema is applied to any positions within the instance array, it produces an annotation result of boolean true, indicating that all remaining @@ -1666,11 +1677,6 @@ array elements have been evaluated against this keyword's subschema. Omitting this keyword has the same assertion behavior as an empty schema. -Implementations MAY choose to implement or optimize this keyword in another way -that produces the same effect, such as by directly checking for the presence and -size of a `prefixItems` array. Implementations that do not support annotation -collection MUST do so. - The presence of this keyword affects the behavior of [`unevaluatedItems`](#unevaluateditems). @@ -1712,7 +1718,8 @@ The annotation result of this keyword is the set of instance property names matched by at least one property under this keyword. The presence of this keyword affects the behaviors of -[`additionalProperties`(#additionalproperties) and [`unevaluatedProperties`](#unevaluatedproperties). +[`additionalProperties`(#additionalproperties) and +[`unevaluatedProperties`](#unevaluatedproperties). ##### `additionalProperties` {#additionalproperties} @@ -1789,12 +1796,12 @@ The minimum number of occurrences is provided by the `minContains` keyword within the same schema object as `contains`. If `minContains` is absent, the minimum number of occurrences MUST be 1. -This keyword produces an annotation value which is an array of the indices for -which this keyword validates successfully when applying its subschema, in -ascending order. The value MAY be a boolean `true` if the subschema validates -successfully when applied to every index of the instance. The annotation MUST be -present if the instance array to which this keyword's schema applies -is empty. +This keyword produces an annotation value which is an array of the zero-based +indices for which this keyword validates successfully when applying its +subschema, in ascending order. The value MAY be a boolean `true` if the +subschema validates successfully when applied to every index of the instance. +The annotation MUST be present if the instance array to which this keyword's +schema applies is empty. The presence of this keyword affects the behavior of [`unevaluatedItems`](#unevaluateditems).