Coverage for /pythoncovmergedfiles/medio/medio/src/jsonschema/jsonschema/_typing.py: 89%
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 collections.abc import Iterable
5from typing import Any, Callable, Protocol, Union
7import referencing.jsonschema
9from jsonschema.protocols import Validator
12class SchemaKeywordValidator(Protocol):
13 def __call__(
14 self,
15 validator: Validator,
16 value: Any,
17 instance: Any,
18 schema: referencing.jsonschema.Schema,
19 ) -> None:
20 ...
23id_of = Callable[[referencing.jsonschema.Schema], Union[str, None]]
26ApplicableValidators = Callable[
27 [referencing.jsonschema.Schema],
28 Iterable[tuple[str, Any]],
29]