-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Possible mishandling in allOf
keyword canonicalisation
#65
Comments
Canonicalising should remove the |
Aha, I missed that :) I found it in my experiment branch, where I didn't inline references at all.
Would it make sense if I submit a PR that will handle it? I.e. to be future-compatible with recursive references? Or is it better to add it as a part of that recursive references PR? |
I'd be happy either way, but I don't think we can really test it separately so let's keep them together. |
Having checked on master, this no longer happens 🙂 |
Consider the following schema:
If we call
jsonschema.validate({}, SCHEMA)
then it will complain that'foo' is a required property
which is expected. But, if we canonicalise the schema, then$ref
keyword will be placed to the schema's root and will cancel the validation of other keywords as implemented in jsonschema. I can't find the exact place in the spec itself, but there are tests in the JSON Schema suite that ensure that other keywords are ignored.So, with the canonicalised version of the schema an empty object passes validation:
What would be the best way to solve it? Should we check if there are schemas with
$ref
keywords, then keep them insideallOf
and move everything else to the previous level?P.S. I found the issue via
Webpack bootstrap-loader configuration file
schema in the testing catalogThe text was updated successfully, but these errors were encountered: