-
Notifications
You must be signed in to change notification settings - Fork 167
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
Changes necessary to support jsonschema 3.x #3705
Changes necessary to support jsonschema 3.x #3705
Conversation
@@ -293,7 +293,7 @@ def _fits_item_recurse(validator, items, instance, schema): | |||
def _fits_type(validator, items, instance, schema): | |||
if instance in ('N/A', '#TODO', '', None): | |||
return | |||
return validators._validators.type_draft4(validator, items, instance, schema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method disappears in jsonschema 3.0, but luckily there is a way to access it through a public API that does not change between the versions.
@@ -1,5 +1,5 @@ | |||
{ | |||
"$schema": "http://json-schema.org/schema#", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes jsonschema to use the latest draft, whatever that is, which is a deprecated behavior in jsonschema 3.0. Also, the latest draft is now draft-07, whereas in jsonschema 2.6 it was draft-04 anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @stscieisenhamer
@@ -1,5 +1,5 @@ | |||
{ | |||
"$schema": "http://json-schema.org/schema#", | |||
"$schema": "http://json-schema.org/draft-04/schema", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we'll have to manually update this whenever we want to start using a new draft?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's correct. Incidentally, later versions aren't backwards compatible with draft-04, so we'll need to audit these files anyway.
@@ -1,5 +1,5 @@ | |||
{ | |||
"$schema": "http://json-schema.org/schema#", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @stscieisenhamer
don't forget the change log |
b4a9633
70302be
to
b4a9633
Compare
@eslavich Could you fix the conflict? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
And it is good that the jsonschema<=2.6
was not changed in setup.py
. I think we can change that in a separate PR after a new release of asdf
supporting jsonschema>=3.0
is released. That way we can avoid order-of-install issues with pip
.
It's been pointed out that jsonschema 2.6 is incompatible with Python 3.8, so at some point we'll need to upgrade. These changes make jwst compatible with both jsonschema 2.6 and 3.0.