Skip to content

Commit 9c3e430

Browse files
committed
lists as additional properties fix
1 parent 5ba7b61 commit 9c3e430

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openapi_core/unmarshalling/schemas/unmarshallers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ class ArrayUnmarshaller(ComplexUnmarshaller):
181181

182182
@property
183183
def items_unmarshaller(self) -> "BaseSchemaUnmarshaller":
184-
return self.unmarshallers_factory.create(self.schema / "items")
184+
# sometimes we don't have any schema i.e. free-form objects
185+
items_schema = self.schema.get("items", Spec.from_dict({}))
186+
return self.unmarshallers_factory.create(items_schema)
185187

186188
def __call__(self, value: Any) -> Optional[List[Any]]:
187189
value = super().__call__(value)

tests/unit/unmarshalling/test_unmarshal.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,7 @@ def test_write_only_properties_invalid(self, unmarshaller_factory):
818818
)
819819

820820
def test_additional_properties_list(self, unmarshaller_factory):
821-
schema = {
822-
"type": "object"
823-
}
821+
schema = {"type": "object"}
824822
spec = Spec.from_dict(schema)
825823

826824
result = unmarshaller_factory(spec, context=UnmarshalContext.RESPONSE)(

0 commit comments

Comments
 (0)