Skip to content

Commit

Permalink
Schemas can be bools too in newer drafts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Dec 15, 2021
1 parent f1240a7 commit 92d93c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jsonschema/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 92d93c1

Please sign in to comment.