Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/jsonschema/_typing.py: 90%
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 Callable, Iterable
5from typing import Any, Protocol
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], str | None]
26ApplicableValidators = Callable[
27 [referencing.jsonschema.Schema],
28 Iterable[tuple[str, Any]],
29]