You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Raina O'Sullivan, Jiří Jeřábek (Jiri Jerabek), Fabio Cerqueira, Daniel Fangl, David Diaz Barquero, bermanalon-pagaya, David Tucker, Ben Eustace and Nico Neumann
Facing the same issue right now. Was a result of the following commit which renamed _legacy_validators to _legacy_keywords: python-jsonschema/jsonschema@9313230
Some OpenAPI schema keywords (such as anyOf, oneOf, allOf) are extended versions of Draft ones.
I've just noticed both the private usage and this issue -- there's no reason to use private APIs even if this is the case. There's perfectly public APIs for doing this, it's e.g. Draft202012Validator.VALIDATORS["anyOf"] etc., which get you the JSON Schema Draft 2020-12 implementation of that keyword. That's documented in the note for jsonschema.validators.extend though let me know if there's an even more obvious place you would have looked, as documentation is always lacking.
And please always raise such things even if there were missing APIs -- private indeed means private and can change at any time.
Activity
TheTeaCat commentedon Sep 20, 2023
Facing the same issue right now. Was a result of the following commit which renamed
_legacy_validatorsto_legacy_keywords: python-jsonschema/jsonschema@9313230rochacbruno commentedon Sep 20, 2023
@TheTeaCat workaround for now is
jsonschema<=4.19.0hotfix: jsonschema import error (#1894)
tucked commentedon Sep 20, 2023
Is there a reason we need to access a private API here?
p1c2u commentedon Sep 20, 2023
Some OpenAPI schema keywords (such as anyOf, oneOf, allOf) are extended versions of Draft ones.
Julian commentedon Jan 4, 2024
I've just noticed both the private usage and this issue -- there's no reason to use private APIs even if this is the case. There's perfectly public APIs for doing this, it's e.g.
Draft202012Validator.VALIDATORS["anyOf"]etc., which get you the JSON Schema Draft 2020-12 implementation of that keyword. That's documented in the note forjsonschema.validators.extendthough let me know if there's an even more obvious place you would have looked, as documentation is always lacking.And please always raise such things even if there were missing APIs -- private indeed means private and can change at any time.