Add enum support for model property of python client

This commit is contained in:
geekerzp
2015-07-16 17:24:42 +08:00
parent 157b07e552
commit f0e09ae33a
13 changed files with 287 additions and 38 deletions

View File

@@ -149,7 +149,7 @@ class ApiClient(object):
# Convert model obj to dict except attributes `swagger_types`, `attribute_map`
# and attributes which value is not None.
# Convert attribute name to json key in model definition for request.
obj_dict = {obj.attribute_map[key]: val
obj_dict = {obj.attribute_map[key[1:]]: val
for key, val in iteritems(obj.__dict__)
if key != 'swagger_types' and key != 'attribute_map' and val is not None}
return {key: self.sanitize_for_serialization(val)