-
-
Notifications
You must be signed in to change notification settings - Fork 753
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
Update jsonschema version to 3.0.1 & JSON Schema draft to 7 #996
Conversation
@@ -151,7 +151,7 @@ def schema_response_integer(valid): | |||
if valid == "valid": | |||
return 3 | |||
else: | |||
return 3.0 | |||
return 3.14 |
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.
what's the background of this change?
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.
Seems that jsonschema draft 7 treats 3.0
as integer; because from a mathematical point of view 3.0 == 3
, I think.
I havent search where/when such change has been made in jsonschema.
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.
Unit tests were failing without that update. And because it looks pretty resonable, I applied that.
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.
the openapi spec is explicitly based on draft 4. |
I didn't know that. What are the reasons for that? |
It looks like my response wasn't quite right (sorry I was on mobile). I don't have the details on why, but i do think it's important to follow the spec. |
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.
I think swagger 2.0 needs to continue to use draft-4, but openapi 3.0 could be updated to draft-5.
I assume that there might not be easy way of using two different jsonchema drafts simultaneously?
According to official JSON Schema website, Draft 5 should not be used, so Draft 6 is natural choice then, as a closest next version... But because Draft 7 is is fully backwards-compatible with Draft 6, we should use it, IMO. |
There might be one more problem... The p1c2u/openapi-spec-validator package, which is the dependency of Connexion. It looks not very well maintained 🤔 and it still relies on Draft 4. |
Such update is far more complex than it looks, more details in #983. |
Fixes #983.
Changes proposed in this pull request:
jsonschema
requirement version to>=3.0.1,4.0.0
4
to7
Related Pull Request(s):