Skip to content

"unevaluatedItems", "additionalItems", and tuple "items" #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 of 6 tasks
handrews opened this issue Oct 20, 2019 · 0 comments · Fixed by #639
Closed
4 of 6 tasks

"unevaluatedItems", "additionalItems", and tuple "items" #292

handrews opened this issue Oct 20, 2019 · 0 comments · Fixed by #639
Labels
missing test A request to add a test to the suite that is currently not covered elsewhere.
Milestone

Comments

@handrews
Copy link
Contributor

handrews commented Oct 20, 2019

unevaluatedItems should apply to instance items past the end of the items tuple the same way as additionalItems, except that it works with items across a reference or allOf or whatever.

If additionalItems is present with items, then (because that subschema will only pass if both items and additionalItems pass), unevaluatedItems is always ignored. additionalItems consumes the whole remainder of the array.

  • test unevaluatedItems with tuple items only, same-object: here
  • test unevaluatedItems with tuple items only, through applicator: here
  • test unevaluatedItems with tuple items and additionalItems, same object: here
  • test unevaluatedItems with tuple items and additionalItems, through applicator: here
  • test unevaluatedItems ignores additionalItems without items, same object
  • test unevaluatedItems ignores additionalItems without items, through applicator

Note that putting items and additionalItems in separate applicator subschemas is identical to just having items, as a lone additionalItems always has no effect.

@handrews handrews added this to the 2019-09 milestone Oct 20, 2019
@Julian Julian added the missing test A request to add a test to the suite that is currently not covered elsewhere. label Nov 29, 2019
Julian added a commit that referenced this issue Feb 21, 2023
The interesting bit here actually *only* applies to 2019, as it's the
only draft containing both unevaluatedItems as well as additionalItems
-- the latter in its specified behavior containing:

   if "items" is absent or its annotation result is the
   boolean true, "additionalItems" MUST be ignored.

(from https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-02#section-9.3.1.2)

In newer drafts (i.e. 2020), when additionalItems "became" items, this
condition was dropped (i.e. items without a neighboring prefixItems now
is indeed *not* ignored).

Refs: https://github.com/orgs/json-schema-org/discussions/57

Closes: #292
Julian added a commit that referenced this issue Feb 21, 2023
The interesting bit here actually *only* applies to 2019, as it's the
only draft containing both unevaluatedItems as well as additionalItems
-- the latter in its specified behavior containing:

   if "items" is absent or its annotation result is the
   boolean true, "additionalItems" MUST be ignored.

(from https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-02#section-9.3.1.2)

In newer drafts (i.e. 2020), when additionalItems "became" items, this
condition was dropped (i.e. items without a neighboring prefixItems now
is indeed *not* ignored).

Refs: https://github.com/orgs/json-schema-org/discussions/57

Closes: #292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing test A request to add a test to the suite that is currently not covered elsewhere.
Projects
None yet
2 participants