Repository navigation
Conversation
The unevaluatedItems keyword was ignored, so arrays with items that no other keyword evaluated passed validation. In Draft 2019-09 the evaluated items always form a prefix of the array, so the constraint derives how many leading items are evaluated by items, additionalItems, nested unevaluatedItems and the valid branches of $ref, allOf, anyOf, oneOf and if/then/else. The remaining items are validated against the unevaluatedItems schema or reported as unevaluated. The JSON Schema Test Suite cases for unevaluatedItems are no longer skipped, except those relying on $recursiveRef. The ref.json case "$ref with $recursiveAnchor: extra items allowed for inner arrays" is skipped now, as $ref "#" resolves against the root schema instead of the embedded $id resource. Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
Roman3349
force-pushed
the
feat/unevaluated-items
branch
from
October 18, 2026 11:41
3a57f40 to
71c0244
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Draft 2019-09 ignored the
unevaluatedItemskeyword, so arrays with items that no other keyword evaluated passed validation.This adds
UnevaluatedItemsConstraint, built the same way asUnevaluatedPropertiesConstraint. In Draft 2019-09 the evaluated items are always at the start of the array, so the constraint only counts how many leading items are evaluated by:items(a schema evaluates every item; an array of schemas evaluates the first N items),additionalItemsnext to an array-formitems(every item),unevaluatedItems: true(every item),$ref,allOf,anyOf,oneOfandif/then/else(notis ignored).The remaining items are checked against the
unevaluatedItemsschema. WhenunevaluatedItemsisfalse, each one is reported as a newConstraintError::UNEVALUATED_ITEMSat its own index.Related Issue
None.
Type of Change
Checklist
Additional Notes