-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Support jsonschema >= 3.0.0 #1050
Conversation
Other projects have started using jsonschema >= 3.0.0, and modern python packaging tools such as poetry now fail to install projects using both connexion and a different dependency if they depend on different versions of jsonschema. Allow jsonschema versions >= 3.0.0 to avoid this problem. See: python-poetry/poetry#697
jsonschema 3.0.0 changed the API to deprecate the types parameter of the jsonschema.IValidator constructor and now raises a warning when using it. Avoid the warning by checking the jsonschema version and switching to the new way to implement this when it is >= 3.0. Note that while jsonschema 2.x did have jsonschema.validators.extend, it did not support the type_checker argument, so the same code cannot be used with jsonschema 2.x.
ping? |
I'm not sure, but I remember in other PRs that there was potentially an issue with a new jsonschema version -- I wonder what prevented us from updating earlier? |
@hjacobs I think the other attempts to update jsonschema also talked about getting new validation functionality (e.g. against the newer draft versions) into connexion, which isn't as simple. This PR doesn't do that, it just updates the dependency but keeps all validation behavior the same. |
👍 |
FYI, I found the change to allow jsonschema>=3.0.0 prevented connexion 2.4.0 from running for me because I'm using Python 2.7 and this happened because jsonschema 3.x eventually brings in the more_itertools package which now requires on Python 3.5 or later. In my case the dependency order was connexion 2.4.0->jsonschema 3.1.1 ->zipp 0.6.0->more_itertools 7.2.0. |
@vssteve Nothing in this PR requires jsonschema > 3. You can just manually downgrade jsonschema to a version < 3 for the remaining two months that python 2.7 is still supported. |
Is this update included in any releases of connexion? It looks like it's not included in the 2.7 release on PyPI... |
Fixes #983.
Other projects have started using jsonschema >= 3.0.0, and modern python packaging tools such as poetry now fail to install projects using both connexion and a different dependency if they depend on different versions of jsonschema.
Allow jsonschema versions >= 3.0.0 to avoid this problem. Add a version branch to avoid a warning that would otherwise be thrown by jsonschema when using the deprecated
types
parameter of the jsonschema.IValidator constructor.Changes proposed in this pull request: