-
-
Notifications
You must be signed in to change notification settings - Fork 615
Expand file tree
/
Copy path_typing.py
More file actions
29 lines (21 loc) · 617 Bytes
/
_typing.py
File metadata and controls
29 lines (21 loc) · 617 Bytes
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 Callable, Iterable
from typing import Any, Protocol
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], str | None]
ApplicableValidators = Callable[
[referencing.jsonschema.Schema],
Iterable[tuple[str, Any]],
]