Skip to content

Commit 5ba7b61

Browse files
committed
Add failing test for lists as additional properties
1 parent 0567647 commit 5ba7b61

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/unit/unmarshalling/test_unmarshal.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,3 +816,16 @@ def test_write_only_properties_invalid(self, unmarshaller_factory):
816816
unmarshaller_factory(spec, context=UnmarshalContext.RESPONSE)(
817817
{"id": 10}
818818
)
819+
820+
def test_additional_properties_list(self, unmarshaller_factory):
821+
schema = {
822+
"type": "object"
823+
}
824+
spec = Spec.from_dict(schema)
825+
826+
result = unmarshaller_factory(spec, context=UnmarshalContext.RESPONSE)(
827+
{"user_ids": [1, 2, 3, 4]}
828+
)
829+
830+
assert is_dataclass(result)
831+
assert result.user_ids == [1, 2, 3, 4]

0 commit comments

Comments
 (0)