-
Notifications
You must be signed in to change notification settings - Fork 16
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
JSON Schema string is inconsistent (no trailing #) #111
Comments
Ahh, finally found a fairly official reference: https://json-schema.org/understanding-json-schema/reference/schema#schema - which does include the |
Hi @henryiii, thank you very much for pointing this out. That was probably an oversight. |
Okay, I'll try to work on this soon, after #112. |
In trying to support SchemaStore and validate-pyproject, I've run into a really annoying inconsistency. SchemaStore's JSON validator checks that the
$schema
property is a valid schema:But validate-pyproject requires
"http://json-schema.org/draft-07/schema"
(since fastjsonschema requires a subschema matches the parent schema exactly), so all plugins currently require the#
not be present.As far as I can tell, SchemaStore is correct - the correct spelling is with the trailing
#
, it was not removed until draft 2019-09 moved tohttps
. And there are already 700+ schemas on SchemaStore there using it. :)If you agree that the trailing
#
is correct, I think it would be easy to migrate, since validate-pyproject gets to pre-process schemas that go to fastjsonschema. The steps would be:"http://json-schema.org/draft-07/schema#"
"http://json-schema.org/draft-07/schema"
. If they do, make a shallow copy and modify the $schema to have the trailing#
.Doing it sooner rather than later would be ideal, so more plugins don't keep appearing with the missing
#
.If we didn't change this, then we could still handle this in reverse when loading a plugin, we could strip the
#
instead, so it's not a blocker for SchemaStore support.Thoughts?
The text was updated successfully, but these errors were encountered: