forked from loafle/openapi-generator-original
[python-flask] adopt python3.5+ syntax (#16375)
* adopt python3.5+ syntax removing some residual python2 code, since it is not supported anymore, like: - no need for `six` anymore - no need for encoding utf8 in top file - remove `object` inheritance in base model - remove absolute import `__future__` * generate samples applying the new templates * update python ignore pattern ignore all the `.venv` folders
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from connexion.apps.flask_app import FlaskJSONEncoder
|
||||
import six
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
|
||||
@@ -10,7 +9,7 @@ class JSONEncoder(FlaskJSONEncoder):
|
||||
def default(self, o):
|
||||
if isinstance(o, Model):
|
||||
dikt = {}
|
||||
for attr, _ in six.iteritems(o.openapi_types):
|
||||
for attr in o.openapi_types:
|
||||
value = getattr(o, attr)
|
||||
if value is None and not self.include_nulls:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user