-
Notifications
You must be signed in to change notification settings - Fork 20
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
$id must be valid URI in json schema #56
Comments
This comment has been minimized.
This comment has been minimized.
Thanks for writing this up! Looks like Mediawiki's $id aren't intended to be URIs, so it makes sense they would use the relative path. Since we have a domain component already, let's add a schema and do https://? |
MediaWiki's
I'm ok with this. I do think absolute URIs work for us better since we have multiple domains for different schemas, especially with client events. Thanks! |
Problem
Since JSON Schema Draft 6,
$id
is required to be a valid URI reference as defined in RFC3986, section 4.1, which is either a URI (e.g.,http://eventlogging.jupyter.org/event-schema
) or a relative reference ( e.g.,/event-schema
). Currently, the$id
s used in event schemas across different Jupyter project do not follow this rule:binderhub.jupyter.org/launch
hub.jupyter.org/server-action
They lack the scheme part of the URI and thus are not valid URIs.
Due to this the schemas are not guaranteed to always work with JSON schema validators. One example is when trying to use
$ref
This would fail
Change to
"$id": "http://hub.jupyter.org/example-schema"
or"$id": "/example-schema"
and it validates fine.There are potentially other undiscovered problems as well.
Proposed solution
Either change
$id
to fully formed URI or keep it as a relative reference. The later is what's being used in MediaWiki eventlogging (example)The text was updated successfully, but these errors were encountered: