Skip to content

Commit

Permalink
fix circular import issue in python flask (OpenAPITools#946)
Browse files Browse the repository at this point in the history
* fix circular import issue in python flask

This is very similar change to 3678eaf
All it intends to do is fix the problem of cirular imports (which was
already fixed for python) in the python flask server.

* removal of type hints in quotes
wheelsandmetal authored and wing328 committed Sep 9, 2018
1 parent b424646 commit 2101882
Showing 19 changed files with 797 additions and 807 deletions.
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@ from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401

from {{modelPackage}}.base_model_ import Model
{{#imports}}{{import}} # noqa: F401,E501
{{/imports}}
from {{packageName}} import util


@@ -27,7 +25,7 @@ class {{classname}}(Model):
{{/-last}}
{{/enumVars}}{{/allowableValues}}

def __init__(self{{#vars}}, {{name}}{{^supportPython2}}: {{dataType}}{{/supportPython2}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501
def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501
"""{{classname}} - a model defined in OpenAPI

{{#vars}}
@@ -37,7 +35,7 @@ class {{classname}}(Model):
"""
self.openapi_types = {
{{#vars}}
'{{name}}': {{{dataType}}}{{#hasMore}},{{/hasMore}}
'{{name}}': '{{{dataType}}}'{{#hasMore}},{{/hasMore}}
{{/vars}}
}

@@ -64,7 +62,7 @@ class {{classname}}(Model):

{{/-first}}
@property
def {{name}}(self){{^supportPython2}} -> {{dataType}}{{/supportPython2}}:
def {{name}}(self):
"""Gets the {{name}} of this {{classname}}.

{{#description}}
@@ -77,7 +75,7 @@ class {{classname}}(Model):
return self._{{name}}

@{{name}}.setter
def {{name}}(self, {{name}}{{^supportPython2}}: {{dataType}}{{/supportPython2}}):
def {{name}}(self, {{name}}):
"""Sets the {{name}} of this {{classname}}.

{{#description}}
@@ -158,4 +156,4 @@ class {{classname}}(Model):
{{/vars}}

{{/model}}
{{/models}}
{{/models}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0-SNAPSHOT
3.3.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -26,9 +26,9 @@ def __init__(self, code=None, type=None, message=None): # noqa: E501
:type message: str
"""
self.openapi_types = {
'code': int,
'type': str,
'message': str
'code': 'int',
'type': 'str',
'message': 'str'
}

self.attribute_map = {
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@ def __init__(self, id=None, name=None): # noqa: E501
:type name: str
"""
self.openapi_types = {
'id': long,
'name': str
'id': 'long',
'name': 'str'
}

self.attribute_map = {
Original file line number Diff line number Diff line change
@@ -32,12 +32,12 @@ def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=N
:type complete: bool
"""
self.openapi_types = {
'id': long,
'pet_id': long,
'quantity': int,
'ship_date': datetime,
'status': str,
'complete': bool
'id': 'long',
'pet_id': 'long',
'quantity': 'int',
'ship_date': 'datetime',
'status': 'str',
'complete': 'bool'
}

self.attribute_map = {
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@
from typing import List, Dict # noqa: F401

from openapi_server.models.base_model_ import Model
from openapi_server.models.category import Category # noqa: F401,E501
from openapi_server.models.tag import Tag # noqa: F401,E501
from openapi_server import util


@@ -34,12 +32,12 @@ def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None
:type status: str
"""
self.openapi_types = {
'id': long,
'category': Category,
'name': str,
'photo_urls': List[str],
'tags': List[Tag],
'status': str
'id': 'long',
'category': 'Category',
'name': 'str',
'photo_urls': 'List[str]',
'tags': 'List[Tag]',
'status': 'str'
}

self.attribute_map = {
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@ def __init__(self, id=None, name=None): # noqa: E501
:type name: str
"""
self.openapi_types = {
'id': long,
'name': str
'id': 'long',
'name': 'str'
}

self.attribute_map = {
Original file line number Diff line number Diff line change
@@ -36,14 +36,14 @@ def __init__(self, id=None, username=None, first_name=None, last_name=None, emai
:type user_status: int
"""
self.openapi_types = {
'id': long,
'username': str,
'first_name': str,
'last_name': str,
'email': str,
'password': str,
'phone': str,
'user_status': int
'id': 'long',
'username': 'str',
'first_name': 'str',
'last_name': 'str',
'email': 'str',
'password': 'str',
'phone': 'str',
'user_status': 'int'
}

self.attribute_map = {
Loading

0 comments on commit 2101882

Please sign in to comment.