Skip to content

Commit dcca73d

Browse files
committed
Add tests for const list and dict
1 parent 03d05af commit dcca73d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test_openapi_schema.py

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def test_map_serializer_field_ok(schema: dict):
6060
({"const": "string"}, {"enum": ["string"]}), # string
6161
({"const": True}, {"enum": [True]}), # bool
6262
({"const": None}, None), # none
63+
({"const": {"k": "v", "k2": 10}}, {"enum": [{"k": "v", "k2": 10}]}), # dict
64+
({"const": [10, 20]}, {"enum": [[10, 20]]}), # list
6365
],
6466
)
6567
def test_map_serializer_field_const(schema: dict, expected: Any):

0 commit comments

Comments
 (0)