blob: 1d091d70c7eae070149636ea18b15efcddc0bf8e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
"""
Some (initially private) typing helpers for jsonschema's types.
"""
from collections.abc import Iterable
from typing import Any, Callable, Protocol, Union
import referencing.jsonschema
from jsonschema.protocols import Validator
class SchemaKeywordValidator(Protocol):
def __call__(
self,
validator: Validator,
value: Any,
instance: Any,
schema: referencing.jsonschema.Schema,
) -> None:
...
id_of = Callable[[referencing.jsonschema.Schema], Union[str, None]]
ApplicableValidators = Callable[
[referencing.jsonschema.Schema],
Iterable[tuple[str, Any]],
]
|