Skip to content

Commit a71aa68

Browse files
committed
Add unevaluatedItems
1 parent 488ad8f commit a71aa68

File tree

1 file changed

+61
-3
lines changed

1 file changed

+61
-3
lines changed

jsonschema-core.xml

+61-3
Original file line numberDiff line numberDiff line change
@@ -1346,10 +1346,14 @@
13461346
<t>
13471347
"unevaluatedProperties", whose behavior is defined in terms of
13481348
annotations from "properties", "patternProperties",
1349-
"additionalProperties" and itself.
1349+
"additionalProperties" and itself
13501350
</t>
13511351
<t>
1352-
"additionalItems", whose behavior is defined in terms of "items".
1352+
"additionalItems", whose behavior is defined in terms of "items"
1353+
</t>
1354+
<t>
1355+
"unevaluatedItems", whose behavior is defined in terms of annotations
1356+
from "items", "additionalItems" and itself
13531357
</t>
13541358
</list>
13551359
</t>
@@ -1593,6 +1597,60 @@
15931597
</t>
15941598
</section>
15951599

1600+
<section title="unevaluatedItems" anchor="unevaluatedItems">
1601+
<t>
1602+
The value of "unevaluatedItems" MUST be a valid JSON Schema.
1603+
</t>
1604+
<t>
1605+
The behavior of this keyword depends on the annotation results of
1606+
adjacent keywords that apply to the instance location being validated.
1607+
Specifically, the annotations from "items" and "additionalItems",
1608+
which can come from those keywords when they are adjacent to the
1609+
"unevaluatedItems" keyword. Those two annotations, as well as
1610+
"unevaluatedItems", can also result from any and all adjacent
1611+
<xref target="in-place">in-place applicator</xref> keywords.
1612+
This includes but is not limited to the in-place applicators
1613+
defined in this document.
1614+
</t>
1615+
<t>
1616+
If an "items" annotation is present, and its annotation result
1617+
is a number, and no "additionalItems" or "unevaluatedItems"
1618+
annotation is present, then validation succeeds if every instance
1619+
element at an index greater than the "items" annotation validates
1620+
against "unevaluatedItems".
1621+
</t>
1622+
<t>
1623+
Otherwise, if any "items", "additionalItems", or "unevaluatedItems"
1624+
annotations are present with a value of boolean true, then
1625+
"unevaluatedItems" MUST be ignored. However, if none of these
1626+
annotations are present, "unevaluatedItems" MUST be applied to
1627+
all locations in the array.
1628+
</t>
1629+
<t>
1630+
This means that "items", "additionalItems", and all in-place applicators
1631+
MUST be evaluated before this keyword can be evaluated. Authors of
1632+
extension keywords MUST NOT define an in-place applicator that would need
1633+
to be evaluated before this keyword.
1634+
</t>
1635+
<t>
1636+
If the "unevaluatedItems" subschema is applied to any
1637+
positions within the instance array, it produces an
1638+
annotation result of boolean true, analogous to the
1639+
single schema behavior of "items". If any "unevaluatedItems"
1640+
keyword from any subschema applied to the same instance
1641+
location produces an annotation value of true, then
1642+
the combined result from these keywords is also true.
1643+
</t>
1644+
<t>
1645+
Omitting this keyword has the same assertion behavior as
1646+
an empty schema.
1647+
</t>
1648+
<t>
1649+
Implementations that do not collect annotations MUST raise an error
1650+
upon encountering this keyword.
1651+
</t>
1652+
</section>
1653+
15961654
<section title="contains">
15971655
<t>
15981656
The value of this keyword MUST be a valid JSON Schema.
@@ -1709,7 +1767,7 @@
17091767
adjacent keywords that apply to the instance location being validated.
17101768
Specifically, the annotations from "properties", "patternProperties",
17111769
and "additionalProperties", which can come from those keywords when
1712-
they are adjacent to the "unvevaluatedProperties" keyword. Those
1770+
they are adjacent to the "unevaluatedProperties" keyword. Those
17131771
three annotations, as well as "unevaluatedProperties", can also
17141772
result from any and all adjacent
17151773
<xref target="in-place">in-place applicator</xref> keywords.

0 commit comments

Comments
 (0)