diff options
author | Julian Berman <Julian@GrayVines.com> | 2021-12-15 11:16:42 -0500 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2021-12-15 11:17:12 -0500 |
commit | 92d93c1333027d8a19493c431503f3db171efda9 (patch) | |
tree | ac5de0bf37edc4c3972c27cdf58e5b13ef7fc44d | |
parent | f1240a72a4bab36db8fe72cd5f54769c7873e985 (diff) | |
download | jsonschema-92d93c1333027d8a19493c431503f3db171efda9.tar.gz |
Schemas can be bools too in newer drafts.
-rw-r--r-- | jsonschema/protocols.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/jsonschema/protocols.py b/jsonschema/protocols.py index 1e2689b..8589afe 100644 --- a/jsonschema/protocols.py +++ b/jsonschema/protocols.py @@ -5,7 +5,7 @@ typing.Protocol classes for jsonschema interfaces. # for reference material on Protocols, see # https://www.python.org/dev/peps/pep-0544/ -from typing import Any, ClassVar, Iterator, Optional +from typing import Any, ClassVar, Iterator, Optional, Union try: from typing import Protocol, runtime_checkable @@ -36,7 +36,7 @@ class Validator(Protocol): """ The protocol to which all validator classes should adhere. - :argument dict schema: the schema that the validator object + :argument schema: the schema that the validator object will validate with. It is assumed to be valid, and providing an invalid schema can lead to undefined behavior. See `Validator.check_schema` to validate a schema first. @@ -66,11 +66,11 @@ class Validator(Protocol): TYPE_CHECKER: ClassVar[TypeChecker] #: The schema that was passed in when initializing the object. - schema: dict + schema: Union[dict, bool] def __init__( self, - schema: dict, + schema: Union[dict, bool], resolver: Optional[RefResolver] = None, format_checker: Optional[FormatChecker] = None, ) -> None: |