python-jsonschema / jsonschema

An implementation of the JSON Schema specification for Python
https://python-jsonschema.readthedocs.io
MIT License
4.61k stars 581 forks source link

Feature request: RefResolver/referencing #1153

Closed tschmidtb51 closed 1 year ago

tschmidtb51 commented 1 year ago

Hi @Julian, I just found a the deprecation warning in our CI/CD log:

DeprecationWarning: jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

Honestly, I haven't fully understood the warning but at least I wanted to raise my hand that we are using this to resolve parts of the CSAF schema in our validation process.

Could you please clarify: Do we need to change to a different library or will https://github.com/python-jsonschema/referencing be able to create a resolver that we can pass towards the draft validator?

Flagging @sthagen for attention

Julian commented 1 year ago

Hi there! That message is saying that eventually RefResolver will be removed.

It should be reasonably straightforward to move to using a referencing registry, but precisely how might depend on what you're doing with RefResolver.

Definitely happy to answer questions though.

tschmidtb51 commented 1 year ago

Thank you for your support. The excellent documentation and especially the migration part helped to resolve the issue.

Julian commented 1 year ago

Glad to hear it!