Skip to content

Commit da16e48

Browse files
authored
codegen multi-type support (#134)
Support multi-types in codegen.
1 parent 583497a commit da16e48

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

python/rpdk/python/resolver.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ def translate_type(resolved_type):
2222
if resolved_type.container == ContainerType.PRIMITIVE:
2323
return PRIMITIVE_TYPES[resolved_type.type]
2424

25+
if resolved_type.container == ContainerType.MULTIPLE:
26+
return "Any"
27+
2528
item_type = translate_type(resolved_type.type)
2629

2730
if resolved_type.container == ContainerType.DICT:

tests/plugin/resolver_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@ def test_contains_model_list_containing_model():
5959
ResolvedType(ContainerType.LIST, ResolvedType(ContainerType.MODEL, "Foo")),
6060
)
6161
assert contains_model(resolved_type) is True
62+
63+
64+
def test_translate_type_multiple():
65+
traslated = translate_type(ResolvedType(ContainerType.MULTIPLE, "multiple"))
66+
assert traslated == "Any"

0 commit comments

Comments
 (0)