Skip to content

Commit eb6ec93

Browse files
committed
Add unevaluatedProperties
1 parent 0cce8aa commit eb6ec93

File tree

1 file changed

+58
-3
lines changed

1 file changed

+58
-3
lines changed

jsonschema-core.xml

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,12 @@
13411341
<list>
13421342
<t>
13431343
"additionalProperties", whose behavior is defined in terms of
1344-
"properties" and "patternProperties"; and
1344+
"properties" and "patternProperties"
1345+
</t>
1346+
<t>
1347+
"unevaluatedProperties", whose behavior is defined in terms of
1348+
annotations from "properties", "patternProperties",
1349+
"additionalProperties" and itself.
13451350
</t>
13461351
<t>
13471352
"additionalItems", whose behavior is defined in terms of "items".
@@ -1350,7 +1355,7 @@
13501355
</t>
13511356
</section>
13521357

1353-
<section title="Keywords for Applying Subschemas in Place">
1358+
<section title="Keywords for Applying Subschemas in Place" anchor="in-place">
13541359
<t>
13551360
These keywords apply subschemas to the same location in the instance
13561361
as the parent schema is being applied. They allow combining
@@ -1687,14 +1692,64 @@
16871692
an empty schema.
16881693
</t>
16891694
<t>
1690-
Implementation MAY choose to implement or optimize this keyword
1695+
Implementations MAY choose to implement or optimize this keyword
16911696
in another way that produces the same effect, such as by directly
16921697
checking the names in "properties" and the patterns in
16931698
"patternProperties" against the instance property set.
16941699
Implementations that do not support annotation collection MUST do so.
16951700
</t>
16961701
</section>
16971702

1703+
<section title="unevaluatedProperties" anchor="unevaluatedProperties">
1704+
<t>
1705+
The value of "unevaluatedProperties" MUST be a valid JSON Schema.
1706+
</t>
1707+
<t>
1708+
The behavior of this keyword depends on the annotation results of
1709+
adjacent keywords that apply to the instance location being validated.
1710+
Specifically, the annotations from "properties", "patternProperties",
1711+
and "additionalProperties", which can come from those keywords when
1712+
they are adjacent to the "unvevaluatedProperties" keyword. Those
1713+
three annotations, as well as "unevaluatedProperties", can also
1714+
result from any and all adjacent
1715+
<xref target="in-place">in-place applicator</xref> keywords.
1716+
This includes but is not limited to the in-place applicators
1717+
defined in this document.
1718+
</t>
1719+
<t>
1720+
Validation with "unevaluatedProperties" applies only to the child
1721+
values of instance names that do not appear in the "properties",
1722+
"patternProperties", "additionalProperties", or
1723+
"unevaluatedProperties" annotation results that apply to the
1724+
instance location being validated.
1725+
</t>
1726+
<t>
1727+
For all such properties, validation succeeds if the child instance
1728+
validates against the "unevaluatedProperties" schema.
1729+
</t>
1730+
<t>
1731+
This means that "properties", "patternProperties", "additionalProperties",
1732+
and all in-place applicators MUST be evaluated before this keyword can
1733+
be evaluated. Authors of extension keywords MUST NOT define an in-place
1734+
applicator that would need to be evaluated before this keyword.
1735+
</t>
1736+
<t>
1737+
The annotation result of this keyword is the set of instance
1738+
property names validated by this keyword's subschema.
1739+
Annotation results for "unevaluatedProperties" keywords from
1740+
multiple schemas applied to the same instance location are combined
1741+
by taking the union of the sets.
1742+
</t>
1743+
<t>
1744+
Omitting this keyword has the same assertion behavior as
1745+
an empty schema.
1746+
</t>
1747+
<t>
1748+
Implementations that do not collect annotations MUST raise an error
1749+
upon encountering this keyword.
1750+
</t>
1751+
</section>
1752+
16981753
<section title="propertyNames">
16991754
<t>
17001755
The value of "propertyNames" MUST be a valid JSON Schema.

0 commit comments

Comments
 (0)