Skip to content
Closed
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
4 changes: 3 additions & 1 deletion src/cloudformation_cli_python_lib/recast.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def recast_object(
json_data[k] = _recast_lists(cls, k, v, classes)
elif isinstance(v, set):
json_data[k] = _recast_sets(cls, k, v, classes)
elif isinstance(v, str):
elif isinstance(v, str) or isinstance(v, int):
dest_type = _field_to_type(cls.__dataclass_fields__[k].type, k, classes)
json_data[k] = _recast_primitive(dest_type, k, v)
else:
Expand Down Expand Up @@ -70,6 +70,8 @@ def _recast_primitive(cls: Any, k: str, v: str) -> Any:
if v.lower() == "false":
return False
raise InvalidRequest(f'value for {k} "{v}" is not boolean')
if cls == int:
return int(v)
return cls(v)


Expand Down