mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
jsonschema: mark schemas as Mapping[str, Any] (#7489)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
from _typeshed import SupportsKeysAndGetItem
|
||||
from collections.abc import Callable, Generator, Iterable
|
||||
from typing import Any, ClassVar
|
||||
from typing import Any, ClassVar, Mapping
|
||||
|
||||
from ._utils import URIDict
|
||||
|
||||
_Schema = Any
|
||||
_Schema = Mapping[str, Any]
|
||||
|
||||
# This class does not exist at runtime. Compatible classes are created at
|
||||
# runtime by create().
|
||||
@@ -14,18 +14,20 @@ class _Validator:
|
||||
TYPE_CHECKER: Any
|
||||
@staticmethod
|
||||
def ID_OF(schema: _Schema) -> str: ...
|
||||
schema: Any
|
||||
schema: _Schema
|
||||
resolver: Any
|
||||
format_checker: Any
|
||||
evolve: Any
|
||||
def __init__(self, schema: _Schema, resolver: Any | None = ..., format_checker: Any | None = ...) -> None: ...
|
||||
@classmethod
|
||||
def check_schema(cls, schema) -> None: ...
|
||||
def iter_errors(self, instance, _schema: Any | None = ...) -> Generator[Any, None, None]: ...
|
||||
def descend(self, instance, schema, path: Any | None = ..., schema_path: Any | None = ...) -> Generator[Any, None, None]: ...
|
||||
def check_schema(cls, schema: _Schema) -> None: ...
|
||||
def iter_errors(self, instance, _schema: _Schema | None = ...) -> Generator[Any, None, None]: ...
|
||||
def descend(
|
||||
self, instance, schema: _Schema, path: Any | None = ..., schema_path: Any | None = ...
|
||||
) -> Generator[Any, None, None]: ...
|
||||
def validate(self, *args, **kwargs) -> None: ...
|
||||
def is_type(self, instance, type): ...
|
||||
def is_valid(self, instance, _schema: Any | None = ...) -> bool: ...
|
||||
def is_valid(self, instance, _schema: _Schema | None = ...) -> bool: ...
|
||||
|
||||
def validates(version: str) -> Callable[..., Any]: ...
|
||||
def create(
|
||||
@@ -59,7 +61,7 @@ class RefResolver:
|
||||
remote_cache: Any | None = ...,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def from_schema(cls, schema, id_of=..., *args, **kwargs): ...
|
||||
def from_schema(cls, schema: _Schema, id_of=..., *args, **kwargs): ...
|
||||
def push_scope(self, scope) -> None: ...
|
||||
def pop_scope(self) -> None: ...
|
||||
@property
|
||||
@@ -73,5 +75,5 @@ class RefResolver:
|
||||
def resolve_fragment(self, document, fragment): ...
|
||||
def resolve_remote(self, uri): ...
|
||||
|
||||
def validate(instance: object, schema: object, cls: type[_Validator] | None = ..., *args: Any, **kwargs: Any) -> None: ...
|
||||
def validator_for(schema, default=...): ...
|
||||
def validate(instance: object, schema: _Schema, cls: type[_Validator] | None = ..., *args: Any, **kwargs: Any) -> None: ...
|
||||
def validator_for(schema: _Schema | bool, default=...): ...
|
||||
|
||||
Reference in New Issue
Block a user