-
Notifications
You must be signed in to change notification settings - Fork 320
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
Since 1.3.0: $id seems to accept anything #936
Comments
I will look into this. But by itself, "0" may be a valid iri reference if it can resolve to an absolute iri given a base iri. I was hoping to avoid strictly validating |
We just tried migration from 1.2.0 to 1.3.0 and tests were broken. |
The specification uses the term What I will likely do is introduce a configurable |
I have looked at the previous behavior and it looks like it is a semi strict about the $id value. If you loaded your schema from a classpath resource using a URI it doesn't throw in the previous version either. Loading it without a base URI causes it to throw in the previous version. I will try to replicate this previous behavior and set it as the default validator. |
This will be fixed in the next version in the following manner
This will make the behavior the same as 1.2.0. That said if you really need the $id to be valid according to the spec, you would need to write your own implementation. According to the spec
The previous logic since 1.0.33 accepts non-empty fragment ids with the
The following schema does not throw in 1.2.0 and before. {
"$id": "#0",
"$schema": "https://json-schema.org/draft/2020-12/schema"
} |
When passing a schema with an invalid $id, the parsing works since 1.3.0. Previously we were getting a JsonSchemaException.
The following schema does not contain a valid $id
according to: https://json-schema.org/draft/2019-09/json-schema-core#rfc.section.8.2.2
But since 1.3.0 no error is reported.
The text was updated successfully, but these errors were encountered: