Add "unevaluatedProperties" and "unevaluatedItems" #656
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Address #556 and #557.
The only slightly unusual thing here is that while
additionalItems
only takes effect whenitems
is present, due to the more dynamic nature ofunevaluatedItems
, I decided that it could take place whetheritems
is present anywhere or not.I believe the restriction on
additionalItems
is to avoid an ambiguity where you can use eitheritems
oradditionalItems
to perform the same assertion. RequiringadditionalItems
to be ignored in the absence ofitems
makes the single-schema use ofitems
unambiguously the only way to validated every item in an array.For
unevaluatedItems
, it seems more correct for it to apply even when no array elements have had a schema evaluated against them, rather than requiring that somewhere in the depths of subschemas there must have been an array-formitems
. I could be persuaded otherwise, but with this approach, the single schema form ofitems
becomes a way to unconditionally apply a schema to the enter array, whileunevaluatedItems
has an inherently conditional behavior- it applies to all only if none were already evaluated.unevaluatedProperties
has no such ambiguities, and I believe is specified exactly as it has been extensively discussed.