Coverage for /pythoncovmergedfiles/medio/medio/src/jsonschema/jsonschema/_typing.py: 88%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2Some (initially private) typing helpers for jsonschema's types.
3"""
4from typing import Any, Callable, Iterable, Protocol, Tuple, Union
6import referencing.jsonschema
8from jsonschema.protocols import Validator
11class SchemaKeywordValidator(Protocol):
12 def __call__(
13 self,
14 validator: Validator,
15 value: Any,
16 instance: Any,
17 schema: referencing.jsonschema.Schema,
18 ) -> None:
19 ...
22id_of = Callable[[referencing.jsonschema.Schema], Union[str, None]]
25ApplicableValidators = Callable[
26 [referencing.jsonschema.Schema],
27 Iterable[Tuple[str, Any]],
28]