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

Clarify "items"/"additionalItems" interaction. #156

Merged
merged 1 commit into from
Nov 22, 2016

Conversation

handrews
Copy link
Contributor

In #135 the question of whether additionalItems could fail validation
if items is not defined was raised. Since items defines a default
value of {}, it is never undefined, which is clarified in this change.

In json-schema-org#135 the question of whether additionalItems could fail validation
if items is not defined was raised.  Since items defines a default
value of {}, it is never undefined, which is clarified in this change.
@awwright
Copy link
Member

This is an improvement, but I'm thinking the entire section could just be rewritten to something like:

If the instance is an array, then "additionalItems" is invalid if any item in the instance, that hasn't been validated with "items", is invalid

@awwright awwright merged commit 70d6eff into json-schema-org:master Nov 22, 2016
@handrews
Copy link
Contributor Author

From an implementation perspective, I am not tracking which things have and haven't been validated. With additionalItems, I just look at the comparative lengths of items and the instance. That's the rationale for the wording that's there right now. I can therefore validate "additionalItems" without validating "items" (which is only important b/c I am implementing each keyword as a separate pure function and trying to make minimal use of other keywords in each function).

To me, your alternate wording suggests a different implementation approach that is not as useful of a design to me.

@handrews handrews deleted the itemsfix branch November 22, 2016 00:24
@epoberezkin
Copy link
Member

@handrews just to remind, additionalItems can be schema, if items is an array. I guess you mean it anyway.

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

Successfully merging this pull request may close these issues.

3 participants