codekingpro/portable-devtools
114k
1"""2Some (initially private) typing helpers for jsonschema's types.3"""4from collections.abc import Callable, Iterable5from typing import Any, Protocol6 7import referencing.jsonschema8 9from jsonschema.protocols import Validator10 11 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 ...21 22 23id_of = Callable[[referencing.jsonschema.Schema], str | None]24 25 26ApplicableValidators = Callable[27 [referencing.jsonschema.Schema],28 Iterable[tuple[str, Any]],29]30 