Skip to content

Commit c4394b0

Browse files
committed
v20/boolean schemas - remove compat glue
1 parent a2f0675 commit c4394b0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

aiopenapi3/model.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,24 +667,22 @@ def is_type_any(schema: "SchemaType"):
667667
return schema.type is None
668668

669669
@staticmethod
670-
def booleanTrue(schema: Optional[Union["SchemaType", bool]]) -> bool:
670+
def booleanTrue(schema: Optional["SchemaType"]) -> bool:
671671
"""
672672
ACCEPT all?
673673
:param schema:
674674
:return: True if Schema is {} or True or None
675675
"""
676676
if schema is None:
677677
return True
678-
if isinstance(schema, bool):
679-
return schema is True
680678
elif isinstance(schema, (SchemaBase, ReferenceBase)):
681679
"""matches Any - {}"""
682680
return len(schema.model_fields_set) == 0
683681
else:
684682
raise ValueError(schema)
685683

686684
@staticmethod
687-
def booleanFalse(schema: Optional[Union["SchemaType", bool]]) -> bool:
685+
def booleanFalse(schema: Optional["SchemaType"]) -> bool:
688686
"""
689687
REJECT all?
690688
:param schema:
@@ -693,8 +691,6 @@ def booleanFalse(schema: Optional[Union["SchemaType", bool]]) -> bool:
693691

694692
if schema is None:
695693
return False
696-
if isinstance(schema, bool):
697-
return schema is False
698694
elif isinstance(schema, (SchemaBase, ReferenceBase)):
699695
"""match {'not':{}}"""
700696
return (v := getattr(schema, "not_", False)) and Model.booleanTrue(v)

0 commit comments

Comments
 (0)