mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 04:25:50 +08:00
[jsonschema] Fix RefResolver store parameter type (#15542)
Change URIDict to use MutableMapping[str, Any] as the value type throughout, consistent with the actual runtime behavior where store values are schema documents (JSON objects), not plain strings.
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
from _typeshed import Incomplete, SupportsKeysAndGetItem, SupportsNext, SupportsRichComparison
|
||||
from _typeshed import Incomplete, SupportsNext, SupportsRichComparison
|
||||
from collections.abc import Generator, Iterable, Iterator, Mapping, MutableMapping
|
||||
from typing import Literal, TypeVar, overload
|
||||
from typing import Any, Literal, TypeVar, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class URIDict(MutableMapping[str, str]):
|
||||
class URIDict(MutableMapping[str, MutableMapping[str, Any]]):
|
||||
def normalize(self, uri: str) -> str: ...
|
||||
store: dict[str, str]
|
||||
def __init__(self, m: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]], /, **kwargs: str) -> None: ...
|
||||
def __getitem__(self, uri: str) -> str: ...
|
||||
def __setitem__(self, uri: str, value: str) -> None: ...
|
||||
store: dict[str, MutableMapping[str, Any]]
|
||||
def __init__(
|
||||
self,
|
||||
m: Mapping[str, MutableMapping[str, Any]] | Iterable[tuple[str, MutableMapping[str, Any]]],
|
||||
/,
|
||||
**kwargs: MutableMapping[str, Any],
|
||||
) -> None: ...
|
||||
def __getitem__(self, uri: str) -> MutableMapping[str, Any]: ...
|
||||
def __setitem__(self, uri: str, value: MutableMapping[str, Any]) -> None: ...
|
||||
def __delitem__(self, uri: str) -> None: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
@@ -113,7 +113,7 @@ class RefResolver:
|
||||
self,
|
||||
base_uri: str,
|
||||
referrer: dict[str, Incomplete],
|
||||
store: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ...,
|
||||
store: Mapping[str, Mapping[str, Any]] | Iterable[tuple[str, Mapping[str, Any]]] = ...,
|
||||
cache_remote: bool = True,
|
||||
handlers: SupportsKeysAndGetItem[str, _Handler] | Iterable[tuple[str, _Handler]] = (),
|
||||
urljoin_cache=None,
|
||||
|
||||
Reference in New Issue
Block a user