You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jsonschema-core.md
+20-24Lines changed: 20 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -1774,7 +1774,8 @@ 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 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.
1778
1779
1779
1780
An instance is valid against `contains` if the number of elements that are valid
1780
1781
against its subschema is with the inclusive range of the minimum and (if any)
@@ -1807,7 +1808,7 @@ every array element.
1807
1808
accounted for.
1808
1809
- When collecting annotations, to ensure that all annotations are found.
1809
1810
1810
-
## Keywords for Unevaluated Locations
1811
+
## Keywords for Unevaluated Locations {#unevaluated}
1811
1812
1812
1813
The purpose of these keywords is to enable schema authors to apply subschemas to
1813
1814
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
1831
1832
subschemas.
1832
1833
1833
1834
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.
1835
1837
1836
1838
### Keyword Independence
1837
1839
@@ -1847,30 +1849,24 @@ outcomes. However, these keywords are notable exceptions:
1847
1849
1848
1850
The value of `unevaluatedItems` MUST be a valid JSON Schema.
1849
1851
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.
1869
1864
1870
1865
If the `unevaluatedItems` subschema is applied to any positions within the
1871
1866
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.
1874
1870
1875
1871
Omitting this keyword has the same assertion behavior as an empty schema.
0 commit comments