mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-13 08:31:19 +00:00
add model attribute name json key mapping in python clent
This commit is contained in:
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user