connexion icon indicating copy to clipboard operation
connexion copied to clipboard

Fix for Deprecation warning for Validator.iter_errors() Isn't in v2.14.0

Open kodamin opened this issue 3 years ago • 1 comments

Description

When doing a "pip install connexion==2.14.0", the connexion/spec.py appears to have old code "for error in instance_validator.iter_errors(instance['default'], instance)" on line 50. But in the PR https://github.com/spec-first/connexion/pull/1536, it was changed to "for error in instance_validator.evolve(schema=instance).iter_errors(instance['default'])".

I did a "pip show connexion" and it shows version 2.14.0. But it still has the old code in the spec.py.

Expected behaviour

I run "pip install connexion" In connexion/spec.py it should have to code "for error in instance_validator.evolve(schema=instance).iter_errors(instance['default'])"

Actual behaviour

I run "pip install connexion" In connexion/spec.py it has the code "for error in instance_validator.iter_errors(instance['default'], instance)" around line 50

Steps to reproduce

Try running "pip install connexion==2.14.0" and check if the spec.py uses the "evolve" function

Additional info:

Output of the commands:

  • python --version
  • pip show connexion | grep "^Version\:"

kodamin avatar Aug 19 '22 14:08 kodamin

Hi @kodamin, thanks for the report.

This fix was only merged to main on which we are working towards version 3.X. It requires a bump to jsonschema>=4.X which we don't want to do on the 2.X version.

I would accept a PR to the v2 branch that fixes this for jsonschema>=4.X while staying compatible with older versions though.

RobbeSneyders avatar Aug 23 '22 07:08 RobbeSneyders