-
-
Notifications
You must be signed in to change notification settings - Fork 216
Test for unevaluatedItems with contains #738
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
Conversation
I don't think this is correct. See https://json-schema.org/draft/2020-12/release-notes#contains-and-unevaluateditems. |
@karenetheridge I think that is outdated section If i am not wrong try that 2019-09 schema in json schema validator like this |
No, Karen's correct. This behavior was introduced with 2020-12. In 2019-09 I also don't think the 2020-12 test you've included is necessary. |
That issue doesn't mention |
This one #293 Sorry on phone ! { "type": "array", "oneOf": [ { "contains": {"type": "string"} }, { "items": {"type": "integer"} } ], "unevaluatedItems": {"type": "boolean"} } Instance : [true, "hello", false] is true against |
That issue exists as a recognition that
It's a bug in the spec, but we can't edit the spec since it's already published. It was rectified with 2020-12. Comparing the above to the 2020-12 text:
where These tests aren't correct. In 2019-09, That issue can probably just be closed. You always have to go back to the spec to determine what's required. |
Ok that issue and validator behviour convenced me to this conclusion , i will close this (currently on mobile) But that issue still not understandable for me why it is even in milestone of 2019-09? |
I can't say, but it was opened after the spec released. |
Based on the conclusion of the discussion in this GitHub issue, the
contains
keyword annotation is collected byunevaluatedItems
in 2019-09 draft . Therefore, all the tests for contains in the 2020-12 draft should also apply to the 2019-09 draft, if i am not wrong here.Additionally, since the extra items from minContains are also evaluated as shown in #293 , it would be beneficial to add tests for that as well.