|
5 | 5 | # for reference material on Protocols, see
|
6 | 6 | # https://www.python.org/dev/peps/pep-0544/
|
7 | 7 |
|
8 |
| -from typing import Any, ClassVar, Iterator, Optional |
| 8 | +from typing import Any, ClassVar, Iterator, Optional, Union |
9 | 9 |
|
10 | 10 | try:
|
11 | 11 | from typing import Protocol, runtime_checkable
|
@@ -36,7 +36,7 @@ class Validator(Protocol):
|
36 | 36 | """
|
37 | 37 | The protocol to which all validator classes should adhere.
|
38 | 38 |
|
39 |
| - :argument dict schema: the schema that the validator object |
| 39 | + :argument schema: the schema that the validator object |
40 | 40 | will validate with. It is assumed to be valid, and providing
|
41 | 41 | an invalid schema can lead to undefined behavior. See
|
42 | 42 | `Validator.check_schema` to validate a schema first.
|
@@ -66,11 +66,11 @@ class Validator(Protocol):
|
66 | 66 | TYPE_CHECKER: ClassVar[TypeChecker]
|
67 | 67 |
|
68 | 68 | #: The schema that was passed in when initializing the object.
|
69 |
| - schema: dict |
| 69 | + schema: Union[dict, bool] |
70 | 70 |
|
71 | 71 | def __init__(
|
72 | 72 | self,
|
73 |
| - schema: dict, |
| 73 | + schema: Union[dict, bool], |
74 | 74 | resolver: Optional[RefResolver] = None,
|
75 | 75 | format_checker: Optional[FormatChecker] = None,
|
76 | 76 | ) -> None:
|
|
0 commit comments