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
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ class ApiClient:
else:
obj_dict = obj.__dict__

if isinstance(obj_dict, list):
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
return self.sanitize_for_serialization(obj_dict)

return {
key: self.sanitize_for_serialization(val)
for key, val in obj_dict.items()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ def sanitize_for_serialization(self, obj):
else:
obj_dict = obj.__dict__

if isinstance(obj_dict, list):
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
return self.sanitize_for_serialization(obj_dict)

return {
key: self.sanitize_for_serialization(val)
for key, val in obj_dict.items()
Expand Down
4 changes: 4 additions & 0 deletions samples/client/echo_api/python/openapi_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ def sanitize_for_serialization(self, obj):
else:
obj_dict = obj.__dict__

if isinstance(obj_dict, list):
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
return self.sanitize_for_serialization(obj_dict)

return {
key: self.sanitize_for_serialization(val)
for key, val in obj_dict.items()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ def sanitize_for_serialization(self, obj):
else:
obj_dict = obj.__dict__

if isinstance(obj_dict, list):
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
return self.sanitize_for_serialization(obj_dict)

return {
key: self.sanitize_for_serialization(val)
for key, val in obj_dict.items()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ def sanitize_for_serialization(self, obj):
else:
obj_dict = obj.__dict__

if isinstance(obj_dict, list):
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
return self.sanitize_for_serialization(obj_dict)

return {
key: self.sanitize_for_serialization(val)
for key, val in obj_dict.items()
Expand Down