Skip to content

Commit 92d93c1

Browse files
committed
Schemas can be bools too in newer drafts.
1 parent f1240a7 commit 92d93c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jsonschema/protocols.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# for reference material on Protocols, see
66
# https://www.python.org/dev/peps/pep-0544/
77

8-
from typing import Any, ClassVar, Iterator, Optional
8+
from typing import Any, ClassVar, Iterator, Optional, Union
99

1010
try:
1111
from typing import Protocol, runtime_checkable
@@ -36,7 +36,7 @@ class Validator(Protocol):
3636
"""
3737
The protocol to which all validator classes should adhere.
3838
39-
:argument dict schema: the schema that the validator object
39+
:argument schema: the schema that the validator object
4040
will validate with. It is assumed to be valid, and providing
4141
an invalid schema can lead to undefined behavior. See
4242
`Validator.check_schema` to validate a schema first.
@@ -66,11 +66,11 @@ class Validator(Protocol):
6666
TYPE_CHECKER: ClassVar[TypeChecker]
6767

6868
#: The schema that was passed in when initializing the object.
69-
schema: dict
69+
schema: Union[dict, bool]
7070

7171
def __init__(
7272
self,
73-
schema: dict,
73+
schema: Union[dict, bool],
7474
resolver: Optional[RefResolver] = None,
7575
format_checker: Optional[FormatChecker] = None,
7676
) -> None:

0 commit comments

Comments
 (0)