-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
"additionalItems" should not be honored if "items" is an object. #135
Comments
Wrong repo. |
@SereneAnt Just a heads up that language is a tad bit confusing, the language seems to only apply for "items", "additionalItems" should still be able to fail even if "items" isn't defined. If in doubt check the behavior against the official test suite. If it's all too confusing, please let us know. |
there is no test for such scenario in the test suite you are referring to. The draft says in clear terms that additionalItems are only taken into account when items is array. |
Also important is this line in "items":
This means that "items" is effectively always defined, so "additionalItems" cannot be applied unless "items" is an array of schemas. The default empty schema value of "items" takes precedence. |
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.
Oops, that was a typo, I'll edit it. |
As per json-schema specification:
Currently (v 4.0.x), CollectionConstraint makes an extra checks for "additionalItems" if "items" is object and fails validation.
The text was updated successfully, but these errors were encountered: