File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,16 @@ def __init__(
50
50
51
51
52
52
def get_base_format_checker (schema_dialect : str | None ) -> jsonschema .FormatChecker :
53
+ # mypy does not consider a class whose instances match a protocol to match
54
+ # `type[$PROTOCOL]` so this is considered a mismatch
55
+ default_validator_cls : type [jsonschema .Validator ] = (
56
+ jsonschema .Draft202012Validator # type:ignore[assignment]
57
+ )
53
58
# resolve the dialect, if given, to a validator class
54
59
# default to the latest draft
55
60
validator_class = jsonschema .validators .validator_for (
56
61
{} if schema_dialect is None else {"$schema" : schema_dialect },
57
- default = jsonschema . Draft202012Validator ,
62
+ default = default_validator_cls ,
58
63
)
59
64
return validator_class .FORMAT_CHECKER
60
65
Original file line number Diff line number Diff line change @@ -187,7 +187,11 @@ def _get_validator(
187
187
validator_cls = _extend_with_pattern_implementation (validator_cls , regex_impl )
188
188
189
189
# now that we know it's safe to try to create the validator instance, do it
190
- validator = validator_cls (
190
+ #
191
+ # TODO: remove type ignore
192
+ # mypy flags this because of an incorrect signature in typeshed
193
+ # see: https://github.com/python/typeshed/pull/14327
194
+ validator = validator_cls ( # type: ignore[call-arg]
191
195
schema ,
192
196
registry = reference_registry ,
193
197
format_checker = format_checker ,
You can’t perform that action at this time.
0 commit comments