-
Notifications
You must be signed in to change notification settings - Fork 9
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
Disagreement with other schema validators for JSON is valid against more than one schema from 'oneOf'
error
#225
Comments
JSON is valid against more than one schema from 'oneOf'
error
Hey @ilyagr , Interesting. It does seem like a bug. Let me get into it and release a fix today. In the mean-time, you might also be interested in contributing a test case for this to the official JSON Schema Test Suite: https://github.com/json-schema-org/JSON-Schema-Test-Suite/tree/main |
As an aside, I should get https://github.com/jj-vcs/jj/blob/main/cli/src/config-schema.json ingested into https://schemas.sourcemeta.com :) |
This is what it seems to be going on: property names are always strings, so Blaze (https://github.com/sourcemeta/blaze) is too-eagerly optimising out the In any case, are you sure your schema is doing what you expect? If it is a |
See: sourcemeta/jsonschema#225 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fix incoming. Getting the PR merged in Blaze, will bump it here, and release a new version of the CLI. |
See: sourcemeta/jsonschema#225 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #225 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #225 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #225 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #225 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Just released v5.0.2 with the fix: https://github.com/sourcemeta/jsonschema/releases/tag/v5.0.2. Please give it a shot and thanks for reporting this! 🙏🏻 |
Thank you very much for the fix!
I might leave this to you, since you better understand the problem, the policies of the JSON Schema test suite, etc.
Note that the schema changes often as config options are added/removed. We usually recommend people use https://jj-vcs.github.io/jj/latest/config-schema.json, there is also the stable (but also buggy) https://jj-vcs.github.io/jj/v0.26.0/config-schema.json .
Yes, the schema is broken, I'm pretty sure. I'm about to fix it. |
Great stuff and please let us know if there is anything we can ship tooling wise to make your work with JSON Schema more enjoyable! |
For this schema, validating the following
json
passes with
jsonschema validate
v. 5.0.1.Problem: I think it is not supposed to pass.
Other validators report an error, e.g. https://www.jsonschemavalidator.net/s/SVJT4LS6 reports:
https://taplo.tamasfe.dev/configuration/developing-schemas.html behaves the same; changing the metaschema to draft 4 does not change the behavior.
I think the error is real, tha part of the schema in https://github.com/jj-vcs/jj/blob/07c63ed182bb1cbd9b52fe8e4f41638bdb5aafb6/cli/src/config-schema.json#L271-L300 seems buggy (deleting the whole
propertyNames
section together with the now unusedbasicFormatiingLabes
section fixes it). So, this seems like a bug injsonschema
. Both tools claim to support Draft 7 of JSON Schema fully.Aside/FR: If
jsonschema
could have a more detailed error in this case and/or a nice lint, that would be great! This is what I was hoping for when I triedjsonschema
.The text was updated successfully, but these errors were encountered: