Skip to content

Commit

Permalink
Add serialization of ModelComposed (OpenAPITools#5551)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-rosset authored and MikailBag committed Mar 23, 2020
1 parent 8e4bc20 commit 24f822a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ from {{packageName}}.exceptions import ApiValueError
from {{packageName}}.model_utils import (
ModelNormal,
ModelSimple,
ModelComposed,
date,
datetime,
deserialize_file,
Expand Down Expand Up @@ -240,7 +241,7 @@ class ApiClient(object):

if isinstance(obj, dict):
obj_dict = obj
elif isinstance(obj, ModelNormal):
elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed):
# Convert model obj to dict
# Convert attribute name to json key in
# model definition for request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from petstore_api.model_utils import (
ModelNormal,
ModelSimple,
ModelComposed,
date,
datetime,
deserialize_file,
Expand Down Expand Up @@ -233,7 +234,7 @@ def sanitize_for_serialization(self, obj):

if isinstance(obj, dict):
obj_dict = obj
elif isinstance(obj, ModelNormal):
elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed):
# Convert model obj to dict
# Convert attribute name to json key in
# model definition for request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from petstore_api.model_utils import (
ModelNormal,
ModelSimple,
ModelComposed,
date,
datetime,
deserialize_file,
Expand Down Expand Up @@ -233,7 +234,7 @@ def sanitize_for_serialization(self, obj):

if isinstance(obj, dict):
obj_dict = obj
elif isinstance(obj, ModelNormal):
elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed):
# Convert model obj to dict
# Convert attribute name to json key in
# model definition for request
Expand Down

0 comments on commit 24f822a

Please sign in to comment.