[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:
Anis
2023-08-23 04:42:40 +02:00
committed by GitHub
parent 646ec8ba41
commit 00de163655
28 changed files with 23 additions and 117 deletions

View File

@@ -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