Closed foarsitter closed 7 months ago
Sure thing. Will have a review of this later this evening. :)
Yesterday everything seemed fine: https://github.com/foarsitter/flask-restx/actions/runs/6237094186/job/16929870907
Today I messed up the branch while on the phone. @hbusul can you see what's the difference?
I think we might run into problems because currently flask-restx
supports python 3.7 but the new referencing package does not, just looking at the pipelines that ran previously. Can't check right now, but if python 3.7 is end of life we might need to drop support to make this change.
Python 3.7 is indeed EOL since 2023-06-27.
It is not only referencing but also jsonschema that does not support python 3.7 . With 3.7 it does not even import referencing due to a syntax error. I have nothing against for dropping python 3.7 but I do not know if it should be done with this ticket or it should be announced. What do you think about moving to import statement in try-except and fallback to not supported way but that also gives you time until jsonschema really drops it, maybe to counter that we can fix the version and when we get rid of 3.7 we can unfix the version.
Some tests are failing and I'm unable to find a solution.
FAILED tests/test_payload.py::PayloadTest::test_validation_with_inheritance FAILED tests/test_payload.py::PayloadTest::test_validation_on_list
I'm a bit busy but I will try to look at why those are failing ASAP within this week
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
3ea4ce1
) 96.45% compared to head (2715d4a
) 96.44%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Did some investigation on the issue today. Seems that we do not need referencing
after all. #definitions/Person
is a local pointer to within the document. Adding resources
to the references registry
will not help since that adds global reference (i.e. https://yourapi.com/Person).
Instead of keeping a global registry, I added the definitions
to the schema that is going to be validated on the fly. In this way the $ref
's can be resolved and we do not need an external resolver.
Note: In order to make the tests succeed I needed to pin flask < 3.0.0. If we will accept this solution that commit has to be removed.
The last few messages on this PR look strange to me. It seems that this PR was not merged. Could somebody handle this? This issue is bugging me in some of my installations.
@dsrink sorry, I deleted the fork. Opened #592 to fix this.
For what I found is that the
jsonschema
validators are compatible with thereferencing
package resolvers.This change is at least covered by
test_api_payload_strict_verification
.Fixes #553