forked from loafle/openapi-generator-original
@@ -617,16 +617,17 @@ class ApiClient(object):
|
||||
:param klass: class literal.
|
||||
:return: model object.
|
||||
"""
|
||||
instance = klass()
|
||||
|
||||
if not instance.swagger_types:
|
||||
if not klass.swagger_types:
|
||||
return data
|
||||
|
||||
for attr, attr_type in iteritems(instance.swagger_types):
|
||||
kwargs = {}
|
||||
for attr, attr_type in iteritems(klass.swagger_types):
|
||||
if data is not None \
|
||||
and instance.attribute_map[attr] in data \
|
||||
and klass.attribute_map[attr] in data \
|
||||
and isinstance(data, (list, dict)):
|
||||
value = data[instance.attribute_map[attr]]
|
||||
setattr(instance, attr, self.__deserialize(value, attr_type))
|
||||
value = data[klass.attribute_map[attr]]
|
||||
kwargs[attr] = self.__deserialize(value, attr_type)
|
||||
|
||||
instance = klass(**kwargs)
|
||||
|
||||
return instance
|
||||
|
||||
@@ -21,28 +21,30 @@ class ModelReturn(object):
|
||||
NOTE: This class is auto generated by the swagger code generator program.
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
swagger_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
swagger_types = {
|
||||
'_return': 'int'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'_return': 'return'
|
||||
}
|
||||
|
||||
def __init__(self, _return=None):
|
||||
"""
|
||||
ModelReturn - a model defined in Swagger
|
||||
|
||||
:param dict swaggerTypes: The key is attribute name
|
||||
and the value is attribute type.
|
||||
:param dict attributeMap: The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
self.swagger_types = {
|
||||
'_return': 'int'
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'_return': 'return'
|
||||
}
|
||||
|
||||
self.__return = None
|
||||
|
||||
# TODO: let required properties as mandatory parameter in the constructor.
|
||||
# - to check if required property is not None (e.g. by calling setter)
|
||||
# - ApiClient.__deserialize_model has to be adapted as well
|
||||
if _return is not None:
|
||||
self._return = _return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user