Open
Description
ref: python-jsonschema/jsonschema#997
I expected the following code to work when it comes to typing
from typing import Any, Mapping
import jsonschema
store: dict[str, Mapping[str, Any]] = {}
jsonschema.RefResolver(
base_uri=f"file://mypath.json",
referrer={},
store=store
)
However, this gives an error:
test.py:9: error: Argument "store" to "RefResolver" has incompatible type "Dict[str, Mapping[str, Any]]"; expected "Union[SupportsKeysAndGetItem[str, str], Iterable[Tuple[str, str]]]" [arg-type]
Found 1 error in 1 file (checked 1 source file)
defined at
typeshed/stubs/jsonschema/jsonschema/validators.pyi
Lines 66 to 80 in c1d307f
store
is a dict[str, str]
type.
Similarly, referrer
is defined as a dict
(MutableMapping
) but I suspect that could be changed to Mapping
(generically).