Skip to content
Open
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 languages/python/templates/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ class ApiClient(object):
elif isinstance(obj, (list, tuple)):
return [cls.sanitize_for_serialization(item) for item in obj]
if isinstance(obj, dict):
{{! Change - Below if condition added to handle empty dict objects }}
if(len(obj.items()) == 0):
return obj
return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()}
raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__))

Expand Down
Loading