Skip to content
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

Add "unevaluatedProperties" and "unevaluatedItems" #656

Merged
merged 2 commits into from
Nov 8, 2018

Conversation

handrews
Copy link
Contributor

Address #556 and #557.

The only slightly unusual thing here is that while additionalItems only takes effect when items is present, due to the more dynamic nature of unevaluatedItems, I decided that it could take place whether items is present anywhere or not.

I believe the restriction on additionalItems is to avoid an ambiguity where you can use either items or additionalItems to perform the same assertion. Requiring additionalItems to be ignored in the absence of items makes the single-schema use of items 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-form items. I could be persuaded otherwise, but with this approach, the single schema form of items becomes a way to unconditionally apply a schema to the enter array, while unevaluatedItems 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.

Copy link
Member

@Relequestual Relequestual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've forgotten some of the basics of this.
I agree on the proposal, but I'm unsure of the language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants