Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix circular import issue in python flask #946

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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}}
Expand All @@ -37,7 +35,7 @@ class {{classname}}(Model):
"""
self.openapi_types = {
{{#vars}}
'{{name}}': {{{dataType}}}{{#hasMore}},{{/hasMore}}
'{{name}}': '{{{dataType}}}'{{#hasMore}},{{/hasMore}}
{{/vars}}
}

Expand All @@ -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}}
Expand All @@ -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}}
Expand Down Expand Up @@ -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
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading