Skip to content

Commit 0eb1821

Browse files
committed
update unevaluatedItems to remove annotation references
1 parent 1b620aa commit 0eb1821

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

jsonschema-core.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,8 @@ keyword's annotation causes `contains` to assume a minimum value of 1.
17741774

17751775
The value of this keyword MUST be a valid JSON Schema.
17761776

1777-
This keyword applies to array instances by applying its subschema to the array's elements.
1777+
This keyword applies to array instances by applying its subschema to the array's
1778+
elements.
17781779

17791780
An instance is valid against `contains` if the number of elements that are valid
17801781
against its subschema is with the inclusive range of the minimum and (if any)
@@ -1807,7 +1808,7 @@ every array element.
18071808
accounted for.
18081809
- When collecting annotations, to ensure that all annotations are found.
18091810

1810-
## Keywords for Unevaluated Locations
1811+
## Keywords for Unevaluated Locations {#unevaluated}
18111812

18121813
The purpose of these keywords is to enable schema authors to apply subschemas to
18131814
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
18311832
subschemas.
18321833

18331834
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.
1835+
keywords in successfully validated subschemas that apply to the same instance
1836+
location.
18351837

18361838
### Keyword Independence
18371839

@@ -1847,30 +1849,24 @@ outcomes. However, these keywords are notable exceptions:
18471849

18481850
The value of `unevaluatedItems` MUST be a valid JSON Schema.
18491851

1850-
The behavior of this keyword depends on the annotation results of adjacent
1851-
keywords that apply to the instance location being validated. Specifically, the
1852-
annotations from `prefixItems`, `items`, and `contains`, which can come from
1853-
those keywords when they are adjacent to the `unevaluatedItems` keyword. Those
1854-
three annotations, as well as `unevaluatedItems`, can also result from any and
1855-
all adjacent [in-place applicator](#in-place) keywords. This includes but is not
1856-
limited to the in-place applicators defined in this document.
1857-
1858-
If no relevant annotations are present, the `unevaluatedItems` subschema MUST be
1859-
applied to all locations in the array. If a boolean true value is present from
1860-
any of the relevant annotations, `unevaluatedItems` MUST be ignored. Otherwise,
1861-
the subschema MUST be applied to any index greater than the largest annotation
1862-
value for `prefixItems`, which does not appear in any annotation value for
1863-
`contains`.
1864-
1865-
This means that `prefixItems`, `items`, `contains`, and all in-place applicators
1866-
MUST be evaluated before this keyword can be evaluated. Authors of extension
1867-
keywords MUST NOT define an in-place applicator that would need to be evaluated
1868-
after this keyword.
1852+
This keyword applies to array instances by applying its subschema to the array's
1853+
elements.
1854+
1855+
The behavior of this keyword depends on all adjacent keywords as well as
1856+
keywords in successfully validated subschemas that apply to the same instance
1857+
location by evaluating the instance's elements. This includes, but is not
1858+
limited to, `prefixItems`, `items`, and `contains`, itself, and all
1859+
[in-place applicators](#in-place) defined in this document.
1860+
1861+
This keyword applies its subschema to any array elements which have not been
1862+
deemed "evaluated" by other keywords per {#unevaluated}. Validation passes if
1863+
the keyword's subschema validates against all applicable array elements.
18691864

18701865
If the `unevaluatedItems` subschema is applied to any positions within the
18711866
instance array, it produces an annotation result of boolean true, analogous to
1872-
the behavior of `items`. This annotation affects the behavior of
1873-
`unevaluatedItems` in parent schemas.
1867+
the behavior of `items`.
1868+
1869+
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.
18741870

18751871
Omitting this keyword has the same assertion behavior as an empty schema.
18761872

0 commit comments

Comments
 (0)