forked from loafle/openapi-generator-original
Fixed issue that it will throw error when deserialize model in python client.
This commit is contained in:
parent
7d706f6a00
commit
3aa9982b23
@ -2,6 +2,10 @@
|
|||||||
"""Add all of the modules in the current directory to __all__"""
|
"""Add all of the modules in the current directory to __all__"""
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
{{#models}}{{#model}}
|
||||||
|
from .{{classVarName}} import {{classname}}
|
||||||
|
{{/model}}{{/models}}
|
||||||
|
|
||||||
__all__ = []
|
__all__ = []
|
||||||
|
|
||||||
for module in os.listdir(os.path.dirname(__file__)):
|
for module in os.listdir(os.path.dirname(__file__)):
|
||||||
|
@ -17,8 +17,7 @@ import datetime
|
|||||||
import mimetypes
|
import mimetypes
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
import models
|
||||||
from models import *
|
|
||||||
|
|
||||||
|
|
||||||
class ApiClient(object):
|
class ApiClient(object):
|
||||||
@ -211,7 +210,7 @@ class ApiClient(object):
|
|||||||
if (objClass in ['int', 'float', 'long', 'dict', 'list', 'str', 'bool', 'datetime']):
|
if (objClass in ['int', 'float', 'long', 'dict', 'list', 'str', 'bool', 'datetime']):
|
||||||
objClass = eval(objClass)
|
objClass = eval(objClass)
|
||||||
else: # not a native type, must be model class
|
else: # not a native type, must be model class
|
||||||
objClass = eval(objClass + '.' + objClass)
|
objClass = eval('models.' + objClass)
|
||||||
|
|
||||||
if objClass in [int, long, float, dict, list, str, bool]:
|
if objClass in [int, long, float, dict, list, str, bool]:
|
||||||
return objClass(obj)
|
return objClass(obj)
|
||||||
|
@ -2,6 +2,18 @@
|
|||||||
"""Add all of the modules in the current directory to __all__"""
|
"""Add all of the modules in the current directory to __all__"""
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
from .user import User
|
||||||
|
|
||||||
|
from .category import Category
|
||||||
|
|
||||||
|
from .pet import Pet
|
||||||
|
|
||||||
|
from .tag import Tag
|
||||||
|
|
||||||
|
from .order import Order
|
||||||
|
|
||||||
|
|
||||||
__all__ = []
|
__all__ = []
|
||||||
|
|
||||||
for module in os.listdir(os.path.dirname(__file__)):
|
for module in os.listdir(os.path.dirname(__file__)):
|
||||||
|
@ -17,8 +17,7 @@ import datetime
|
|||||||
import mimetypes
|
import mimetypes
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
import models
|
||||||
from models import *
|
|
||||||
|
|
||||||
|
|
||||||
class ApiClient(object):
|
class ApiClient(object):
|
||||||
@ -211,7 +210,7 @@ class ApiClient(object):
|
|||||||
if (objClass in ['int', 'float', 'long', 'dict', 'list', 'str', 'bool', 'datetime']):
|
if (objClass in ['int', 'float', 'long', 'dict', 'list', 'str', 'bool', 'datetime']):
|
||||||
objClass = eval(objClass)
|
objClass = eval(objClass)
|
||||||
else: # not a native type, must be model class
|
else: # not a native type, must be model class
|
||||||
objClass = eval(objClass + '.' + objClass)
|
objClass = eval('models.' + objClass)
|
||||||
|
|
||||||
if objClass in [int, long, float, dict, list, str, bool]:
|
if objClass in [int, long, float, dict, list, str, bool]:
|
||||||
return objClass(obj)
|
return objClass(obj)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user