Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/jsonschema/_typing.py: 88%

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

8 statements  

1""" 

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

3""" 

4from typing import Any, Callable, Iterable, Protocol, Tuple, Union 

5 

6import referencing.jsonschema 

7 

8from jsonschema.protocols import Validator 

9 

10 

11class SchemaKeywordValidator(Protocol): 

12 def __call__( 

13 self, 

14 validator: Validator, 

15 value: Any, 

16 instance: Any, 

17 schema: referencing.jsonschema.Schema, 

18 ) -> None: 

19 ... 

20 

21 

22id_of = Callable[[referencing.jsonschema.Schema], Union[str, None]] 

23 

24 

25ApplicableValidators = Callable[ 

26 [referencing.jsonschema.Schema], 

27 Iterable[Tuple[str, Any]], 

28]