add model attribute name json key mapping in python clent

This commit is contained in:
geekerzp
2015-03-24 11:55:20 +08:00
parent fe82d7dc05
commit 07237f8eb9
2 changed files with 20 additions and 6 deletions

View File

@@ -17,12 +17,17 @@ Copyright 2015 Reverb Technologies, Inc.
{{#models}}
{{#model}}
class {{classname}}:
class {{classname}}(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.
attributeMap (dict): The key is attribute name and the value is json key in definition.
"""
self.swaggerTypes = {
{{#vars}}
'{{name}}': '{{{datatype}}}'{{#hasMore}},
@@ -30,6 +35,11 @@ class {{classname}}:
{{/vars}}{{newline}}
}
self.attributeMap = {
{{#vars}}
'{{name}}': '{{baseName}}'{{#hasMore}},{{/hasMore}}
{{/vars}}
}
{{#vars}}
{{#description}}#{{description}}