-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Bump jsonschema to 4.24.* #14166
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
Bump jsonschema to 4.24.* #14166
Conversation
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This comment has been minimized.
This comment has been minimized.
|
||
def validate(instance: object, schema: Schema, cls: type[_Validator] | None = None, *args: Any, **kwargs: Any) -> None: ... | ||
def validator_for(schema: Schema | bool, default=...): ... | ||
def validator_for(schema: Schema | bool, default: type[_Validator] | Unset = ...) -> type[_Validator]: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the primer output, we probably need to to ._protocols.Validator
here, like the implementation does.
Diff from mypy_primer, showing the effect of this PR on open source code: check-jsonschema (https://github.com/python-jsonschema/check-jsonschema)
+ src/check_jsonschema/formats/__init__.py:57: error: Argument "default" to "validator_for" has incompatible type "type[Draft202012Validator]"; expected "type[Validator] | Unset" [arg-type]
+ src/check_jsonschema/schema_loader/main.py:190: error: Unexpected keyword argument "registry" for "Validator" [call-arg]
+ src/check_jsonschema/schema_loader/main.py:195: error: Redundant cast to "Validator" [redundant-cast]
schemathesis (https://github.com/schemathesis/schemathesis)
- src/schemathesis/specs/openapi/references.py:71: error: Call to untyped function "resolve" in typed context [no-untyped-call]
- src/schemathesis/specs/openapi/security.py:141: error: Call to untyped function (unknown) in typed context [no-untyped-call]
- src/schemathesis/specs/openapi/security.py:143: error: Call to untyped function (unknown) in typed context [no-untyped-call]
- src/schemathesis/specs/openapi/stateful/links.py: note: In function "add_link":
- src/schemathesis/specs/openapi/stateful/links.py:249: error: Call to untyped function "resolve" in typed context [no-untyped-call]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably just get rid of the legacy _Validator
class. (I think it precedes the introduction of the Validator
protocol upstream.) But this is outside the scope of this PR.
Closes: #14162
Actually
_utils.is_valid
function was added