Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/rpdk/python/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def translate_type(resolved_type):
if resolved_type.container == ContainerType.PRIMITIVE:
return PRIMITIVE_TYPES[resolved_type.type]

if resolved_type.container == ContainerType.MULTIPLE:
return "Any"

item_type = translate_type(resolved_type.type)

if resolved_type.container == ContainerType.DICT:
Expand Down
8 changes: 4 additions & 4 deletions tests/plugin/codegen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ def test_initialize(project):
"README.md",
"foo-bar-baz.json",
"requirements.txt",
"inputs/inputs_1_invalid.json",
"inputs/inputs_1_update.json",
"inputs/inputs_1_create.json",
"inputs",
"example_inputs/inputs_1_invalid.json",
"example_inputs/inputs_1_update.json",
"example_inputs/inputs_1_create.json",
"example_inputs",
"src",
"src/foo_bar_baz",
"src/foo_bar_baz/__init__.py",
Expand Down
5 changes: 5 additions & 0 deletions tests/plugin/resolver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ def test_contains_model_list_containing_model():
ResolvedType(ContainerType.LIST, ResolvedType(ContainerType.MODEL, "Foo")),
)
assert contains_model(resolved_type) is True


def test_translate_type_multiple():
traslated = translate_type(ResolvedType(ContainerType.MULTIPLE, "multiple"))
assert traslated == "Any"