forked from loafle/openapi-generator-original
[python-server] Support python 3.7 for all server-generators (#2884)
* Support python 3.7 for all server-generators Signed-off-by: Guillaume Smaha <guillaume.smaha@gmail.com> * Rename typing_patch.py to typing_utils.py * Renaming typing_patch.mustache to typing_utils.mustache * Fix comparaison in typing_utils.is_dict for python3.7
This commit is contained in:
committed by
William Cheng
parent
14118807ba
commit
20b8eff6e3
@@ -2,6 +2,7 @@ import datetime
|
||||
|
||||
import six
|
||||
import typing
|
||||
from openapi_server import typing_utils
|
||||
|
||||
|
||||
def _deserialize(data, klass):
|
||||
@@ -23,10 +24,10 @@ def _deserialize(data, klass):
|
||||
return deserialize_date(data)
|
||||
elif klass == datetime.datetime:
|
||||
return deserialize_datetime(data)
|
||||
elif type(klass) == typing.GenericMeta:
|
||||
if klass.__extra__ == list:
|
||||
elif typing_utils.is_generic(klass):
|
||||
if typing_utils.is_list(klass):
|
||||
return _deserialize_list(data, klass.__args__[0])
|
||||
if klass.__extra__ == dict:
|
||||
if typing_utils.is_dict(klass):
|
||||
return _deserialize_dict(data, klass.__args__[1])
|
||||
else:
|
||||
return deserialize_model(data, klass)
|
||||
|
||||
Reference in New Issue
Block a user