Skip to content

Commit bb94ac7

Browse files
committed
Missed a common corner-case
1 parent 19a5f70 commit bb94ac7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pydanticrud/backends/dynamodb.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,14 @@ def __init__(self, schema):
119119
def _get_type_possibilities(self, field_name) -> Set[tuple]:
120120
field_properties = self.properties.get(field_name)
121121

122+
if not field_properties:
123+
return set()
124+
122125
possible_types = []
123126
if "anyOf" in field_properties:
124127
possible_types.extend([r.get("$ref", r) for r in field_properties["anyOf"]])
125-
elif isinstance(field_properties, dict):
126-
possible_types.append(field_properties.get("$ref", field_properties))
127128
else:
128-
return set()
129+
possible_types.append(field_properties.get("$ref", field_properties))
129130

130131
def type_from_definition(definition_signature: Union[str, dict]) -> dict:
131132
if isinstance(definition_signature, str):

0 commit comments

Comments
 (0)