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

10 statements  

1""" 

2Some (initially private) typing helpers for jsonschema's types. 

3""" 

4from collections.abc import Iterable 

5from typing import Any, Callable, Protocol, Union 

6 

7import referencing.jsonschema 

8 

9from jsonschema.protocols import Validator 

10 

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], Union[str, None]] 

24 

25 

26ApplicableValidators = Callable[ 

27 [referencing.jsonschema.Schema], 

28 Iterable[tuple[str, Any]], 

29]