forked from loafle/openapi-generator-original
[python] Some cleanup of samples folder (#17127)
* Delete sample folders of discontinued clients * Remove duplicate python-flask server sample The python-flask sample actually lives in samples/server/petstore/python-flask. * Move hand-written test to "tests" folder Now, "test" only contains generated stubs and all hand-written tests are in "tests". * Delete left-over files in Python samples These are not created by the generators (anymore) and not hand-written for testing. * Regenerate test file to fix import error
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
7.0.0-SNAPSHOT
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
# List
|
|
||||||
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**var_123_list** | **str** | | [optional]
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```python
|
|
||||||
from petstore_api.models.list import List
|
|
||||||
|
|
||||||
# TODO update the JSON string below
|
|
||||||
json = "{}"
|
|
||||||
# create an instance of List from a JSON string
|
|
||||||
list_instance = List.from_json(json)
|
|
||||||
# print the JSON string representation of the object
|
|
||||||
print List.to_json()
|
|
||||||
|
|
||||||
# convert the object into a dict
|
|
||||||
list_dict = list_instance.to_dict()
|
|
||||||
# create an instance of List from a dict
|
|
||||||
list_form_dict = list.from_dict(list_dict)
|
|
||||||
```
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
import pprint
|
|
||||||
import re # noqa: F401
|
|
||||||
import json
|
|
||||||
|
|
||||||
|
|
||||||
from typing import Optional
|
|
||||||
from pydantic import BaseModel, StrictStr
|
|
||||||
from pydantic import Field
|
|
||||||
from typing import Dict, Any
|
|
||||||
try:
|
|
||||||
from typing import Self
|
|
||||||
except ImportError:
|
|
||||||
from typing_extensions import Self
|
|
||||||
|
|
||||||
class List(BaseModel):
|
|
||||||
"""
|
|
||||||
List
|
|
||||||
"""
|
|
||||||
var_123_list: Optional[StrictStr] = Field(default=None, alias="123-list")
|
|
||||||
__properties = ["123-list"]
|
|
||||||
|
|
||||||
model_config = {
|
|
||||||
"populate_by_name": True,
|
|
||||||
"validate_assignment": True
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def to_str(self) -> str:
|
|
||||||
"""Returns the string representation of the model using alias"""
|
|
||||||
return pprint.pformat(self.model_dump(by_alias=True))
|
|
||||||
|
|
||||||
def to_json(self) -> str:
|
|
||||||
"""Returns the JSON representation of the model using alias"""
|
|
||||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
||||||
return json.dumps(self.to_dict())
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_json(cls, json_str: str) -> Self:
|
|
||||||
"""Create an instance of List from a JSON string"""
|
|
||||||
return cls.from_dict(json.loads(json_str))
|
|
||||||
|
|
||||||
def to_dict(self):
|
|
||||||
"""Returns the dictionary representation of the model using alias"""
|
|
||||||
_dict = self.model_dump(by_alias=True,
|
|
||||||
exclude={
|
|
||||||
},
|
|
||||||
exclude_none=True)
|
|
||||||
return _dict
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, obj: dict) -> Self:
|
|
||||||
"""Create an instance of List from a dict"""
|
|
||||||
if obj is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
if not isinstance(obj, dict):
|
|
||||||
return cls.model_validate(obj)
|
|
||||||
|
|
||||||
_obj = cls.model_validate({
|
|
||||||
"123-list": obj.get("123-list")
|
|
||||||
})
|
|
||||||
return _obj
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
import petstore_api
|
|
||||||
from petstore_api.models.list import List # noqa: E501
|
|
||||||
from petstore_api.rest import ApiException
|
|
||||||
|
|
||||||
class TestList(unittest.TestCase):
|
|
||||||
"""List unit test stubs"""
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def make_instance(self, include_optional):
|
|
||||||
"""Test List
|
|
||||||
include_option is a boolean, when False only required
|
|
||||||
params are included, when True both required and
|
|
||||||
optional params are included """
|
|
||||||
# model = petstore_api.models.list.List() # noqa: E501
|
|
||||||
if include_optional :
|
|
||||||
return List(
|
|
||||||
_123_list = ''
|
|
||||||
)
|
|
||||||
else :
|
|
||||||
return List(
|
|
||||||
)
|
|
||||||
|
|
||||||
def testList(self):
|
|
||||||
"""Test List"""
|
|
||||||
# inst_req_only = self.make_instance(include_optional=False)
|
|
||||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
Binary file not shown.
@@ -1,115 +0,0 @@
|
|||||||
Defaulting to user installation because normal site-packages is not writeable
|
|
||||||
Collecting tox
|
|
||||||
Downloading tox-4.4.12-py3-none-any.whl (148 kB)
|
|
||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 149.0/149.0 KB 3.0 MB/s eta 0:00:00
|
|
||||||
Collecting flake8
|
|
||||||
Downloading flake8-6.0.0-py2.py3-none-any.whl (57 kB)
|
|
||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.8/57.8 KB 10.7 MB/s eta 0:00:00
|
|
||||||
Collecting chardet>=5.1
|
|
||||||
Downloading chardet-5.1.0-py3-none-any.whl (199 kB)
|
|
||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.1/199.1 KB 8.7 MB/s eta 0:00:00
|
|
||||||
Collecting tomli>=2.0.1
|
|
||||||
Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
|
|
||||||
Collecting filelock>=3.11
|
|
||||||
Downloading filelock-3.12.0-py3-none-any.whl (10 kB)
|
|
||||||
Collecting platformdirs>=3.2
|
|
||||||
Downloading platformdirs-3.2.0-py3-none-any.whl (14 kB)
|
|
||||||
Collecting pyproject-api>=1.5.1
|
|
||||||
Downloading pyproject_api-1.5.1-py3-none-any.whl (12 kB)
|
|
||||||
Collecting packaging>=23
|
|
||||||
Downloading packaging-23.1-py3-none-any.whl (48 kB)
|
|
||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 KB 6.8 MB/s eta 0:00:00
|
|
||||||
Collecting pluggy>=1
|
|
||||||
Downloading pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
|
|
||||||
Collecting virtualenv>=20.21
|
|
||||||
Downloading virtualenv-20.22.0-py3-none-any.whl (3.2 MB)
|
|
||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 14.5 MB/s eta 0:00:00
|
|
||||||
Collecting colorama>=0.4.6
|
|
||||||
Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
|
|
||||||
Collecting cachetools>=5.3
|
|
||||||
Downloading cachetools-5.3.0-py3-none-any.whl (9.3 kB)
|
|
||||||
Collecting mccabe<0.8.0,>=0.7.0
|
|
||||||
Downloading mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB)
|
|
||||||
Collecting pycodestyle<2.11.0,>=2.10.0
|
|
||||||
Downloading pycodestyle-2.10.0-py2.py3-none-any.whl (41 kB)
|
|
||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.3/41.3 KB 5.0 MB/s eta 0:00:00
|
|
||||||
Collecting pyflakes<3.1.0,>=3.0.0
|
|
||||||
Downloading pyflakes-3.0.1-py2.py3-none-any.whl (62 kB)
|
|
||||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 14.3 MB/s eta 0:00:00
|
|
||||||
Requirement already satisfied: distlib<1,>=0.3.6 in /home/robbert/.local/lib/python3.10/site-packages (from virtualenv>=20.21->tox->-r dev-requirements.txt (line 1)) (0.3.6)
|
|
||||||
Installing collected packages: tomli, pyflakes, pycodestyle, pluggy, platformdirs, packaging, mccabe, filelock, colorama, chardet, cachetools, virtualenv, pyproject-api, flake8, tox
|
|
||||||
Attempting uninstall: filelock
|
|
||||||
Found existing installation: filelock 3.10.4
|
|
||||||
Uninstalling filelock-3.10.4:
|
|
||||||
Successfully uninstalled filelock-3.10.4
|
|
||||||
Attempting uninstall: virtualenv
|
|
||||||
Found existing installation: virtualenv 20.4.2
|
|
||||||
Uninstalling virtualenv-20.4.2:
|
|
||||||
Successfully uninstalled virtualenv-20.4.2
|
|
||||||
Successfully installed cachetools-5.3.0 chardet-5.1.0 colorama-0.4.6 filelock-3.12.0 flake8-6.0.0 mccabe-0.7.0 packaging-23.1 platformdirs-3.2.0 pluggy-1.0.0 pycodestyle-2.10.0 pyflakes-3.0.1 pyproject-api-1.5.1 tomli-2.0.1 tox-4.4.12 virtualenv-20.22.0
|
|
||||||
Collecting tox (from -r dev-requirements.txt (line 1))
|
|
||||||
Using cached tox-4.4.12-py3-none-any.whl (148 kB)
|
|
||||||
Collecting flake8 (from -r dev-requirements.txt (line 2))
|
|
||||||
Using cached flake8-6.0.0-py2.py3-none-any.whl (57 kB)
|
|
||||||
Collecting cachetools>=5.3 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached cachetools-5.3.0-py3-none-any.whl (9.3 kB)
|
|
||||||
Collecting chardet>=5.1 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached chardet-5.1.0-py3-none-any.whl (199 kB)
|
|
||||||
Collecting colorama>=0.4.6 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
|
|
||||||
Collecting filelock>=3.11 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached filelock-3.12.0-py3-none-any.whl (10 kB)
|
|
||||||
Collecting packaging>=23 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached packaging-23.1-py3-none-any.whl (48 kB)
|
|
||||||
Collecting platformdirs>=3.2 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached platformdirs-3.2.0-py3-none-any.whl (14 kB)
|
|
||||||
Collecting pluggy>=1 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
|
|
||||||
Collecting pyproject-api>=1.5.1 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached pyproject_api-1.5.1-py3-none-any.whl (12 kB)
|
|
||||||
Collecting tomli>=2.0.1 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
|
|
||||||
Collecting virtualenv>=20.21 (from tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached virtualenv-20.22.0-py3-none-any.whl (3.2 MB)
|
|
||||||
Collecting mccabe<0.8.0,>=0.7.0 (from flake8->-r dev-requirements.txt (line 2))
|
|
||||||
Using cached mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB)
|
|
||||||
Collecting pycodestyle<2.11.0,>=2.10.0 (from flake8->-r dev-requirements.txt (line 2))
|
|
||||||
Using cached pycodestyle-2.10.0-py2.py3-none-any.whl (41 kB)
|
|
||||||
Collecting pyflakes<3.1.0,>=3.0.0 (from flake8->-r dev-requirements.txt (line 2))
|
|
||||||
Using cached pyflakes-3.0.1-py2.py3-none-any.whl (62 kB)
|
|
||||||
Collecting distlib<1,>=0.3.6 (from virtualenv>=20.21->tox->-r dev-requirements.txt (line 1))
|
|
||||||
Using cached distlib-0.3.6-py2.py3-none-any.whl (468 kB)
|
|
||||||
Installing collected packages: distlib, tomli, pyflakes, pycodestyle, pluggy, platformdirs, packaging, mccabe, filelock, colorama, chardet, cachetools, virtualenv, pyproject-api, flake8, tox
|
|
||||||
Successfully installed cachetools-5.3.0 chardet-5.1.0 colorama-0.4.6 distlib-0.3.6 filelock-3.12.0 flake8-6.0.0 mccabe-0.7.0 packaging-23.1 platformdirs-3.2.0 pluggy-1.0.0 pycodestyle-2.10.0 pyflakes-3.0.1 pyproject-api-1.5.1 tomli-2.0.1 tox-4.4.12 virtualenv-20.22.0
|
|
||||||
Requirement already satisfied: tox in ./venv/lib/python3.10/site-packages (from -r dev-requirements.txt (line 1)) (4.4.12)
|
|
||||||
Requirement already satisfied: flake8 in ./venv/lib/python3.10/site-packages (from -r dev-requirements.txt (line 2)) (6.0.0)
|
|
||||||
Requirement already satisfied: cachetools>=5.3 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (5.3.0)
|
|
||||||
Requirement already satisfied: chardet>=5.1 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (5.1.0)
|
|
||||||
Requirement already satisfied: colorama>=0.4.6 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (0.4.6)
|
|
||||||
Requirement already satisfied: filelock>=3.11 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (3.12.0)
|
|
||||||
Requirement already satisfied: packaging>=23 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (23.1)
|
|
||||||
Requirement already satisfied: platformdirs>=3.2 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (3.2.0)
|
|
||||||
Requirement already satisfied: pluggy>=1 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (1.0.0)
|
|
||||||
Requirement already satisfied: pyproject-api>=1.5.1 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (1.5.1)
|
|
||||||
Requirement already satisfied: tomli>=2.0.1 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (2.0.1)
|
|
||||||
Requirement already satisfied: virtualenv>=20.21 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (20.22.0)
|
|
||||||
Requirement already satisfied: mccabe<0.8.0,>=0.7.0 in ./venv/lib/python3.10/site-packages (from flake8->-r dev-requirements.txt (line 2)) (0.7.0)
|
|
||||||
Requirement already satisfied: pycodestyle<2.11.0,>=2.10.0 in ./venv/lib/python3.10/site-packages (from flake8->-r dev-requirements.txt (line 2)) (2.10.0)
|
|
||||||
Requirement already satisfied: pyflakes<3.1.0,>=3.0.0 in ./venv/lib/python3.10/site-packages (from flake8->-r dev-requirements.txt (line 2)) (3.0.1)
|
|
||||||
Requirement already satisfied: distlib<1,>=0.3.6 in ./venv/lib/python3.10/site-packages (from virtualenv>=20.21->tox->-r dev-requirements.txt (line 1)) (0.3.6)
|
|
||||||
Requirement already satisfied: tox in ./venv/lib/python3.10/site-packages (from -r dev-requirements.txt (line 1)) (4.4.12)
|
|
||||||
Requirement already satisfied: flake8 in ./venv/lib/python3.10/site-packages (from -r dev-requirements.txt (line 2)) (6.0.0)
|
|
||||||
Requirement already satisfied: cachetools>=5.3 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (5.3.0)
|
|
||||||
Requirement already satisfied: chardet>=5.1 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (5.1.0)
|
|
||||||
Requirement already satisfied: colorama>=0.4.6 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (0.4.6)
|
|
||||||
Requirement already satisfied: filelock>=3.11 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (3.12.0)
|
|
||||||
Requirement already satisfied: packaging>=23 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (23.1)
|
|
||||||
Requirement already satisfied: platformdirs>=3.2 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (3.2.0)
|
|
||||||
Requirement already satisfied: pluggy>=1 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (1.0.0)
|
|
||||||
Requirement already satisfied: pyproject-api>=1.5.1 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (1.5.1)
|
|
||||||
Requirement already satisfied: tomli>=2.0.1 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (2.0.1)
|
|
||||||
Requirement already satisfied: virtualenv>=20.21 in ./venv/lib/python3.10/site-packages (from tox->-r dev-requirements.txt (line 1)) (20.22.0)
|
|
||||||
Requirement already satisfied: mccabe<0.8.0,>=0.7.0 in ./venv/lib/python3.10/site-packages (from flake8->-r dev-requirements.txt (line 2)) (0.7.0)
|
|
||||||
Requirement already satisfied: pycodestyle<2.11.0,>=2.10.0 in ./venv/lib/python3.10/site-packages (from flake8->-r dev-requirements.txt (line 2)) (2.10.0)
|
|
||||||
Requirement already satisfied: pyflakes<3.1.0,>=3.0.0 in ./venv/lib/python3.10/site-packages (from flake8->-r dev-requirements.txt (line 2)) (3.0.1)
|
|
||||||
Requirement already satisfied: distlib<1,>=0.3.6 in ./venv/lib/python3.10/site-packages (from virtualenv>=20.21->tox->-r dev-requirements.txt (line 1)) (0.3.6)
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
Metadata-Version: 2.1
|
|
||||||
Name: petstore-api
|
|
||||||
Version: 1.0.0
|
|
||||||
Summary: OpenAPI Petstore
|
|
||||||
Home-page:
|
|
||||||
Author: OpenAPI Generator community
|
|
||||||
Author-email: team@openapitools.org
|
|
||||||
License: Apache-2.0
|
|
||||||
Keywords: OpenAPI,OpenAPI-Generator,OpenAPI Petstore
|
|
||||||
Description-Content-Type: text/markdown
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \ # noqa: E501
|
|
||||||
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
README.md
|
|
||||||
pyproject.toml
|
|
||||||
setup.cfg
|
|
||||||
setup.py
|
|
||||||
petstore_api/__init__.py
|
|
||||||
petstore_api/api_client.py
|
|
||||||
petstore_api/configuration.py
|
|
||||||
petstore_api/exceptions.py
|
|
||||||
petstore_api/rest.py
|
|
||||||
petstore_api/signing.py
|
|
||||||
petstore_api.egg-info/PKG-INFO
|
|
||||||
petstore_api.egg-info/SOURCES.txt
|
|
||||||
petstore_api.egg-info/dependency_links.txt
|
|
||||||
petstore_api.egg-info/requires.txt
|
|
||||||
petstore_api.egg-info/top_level.txt
|
|
||||||
petstore_api/api/__init__.py
|
|
||||||
petstore_api/api/another_fake_api.py
|
|
||||||
petstore_api/api/default_api.py
|
|
||||||
petstore_api/api/fake_api.py
|
|
||||||
petstore_api/api/fake_classname_tags123_api.py
|
|
||||||
petstore_api/api/fake_classname_tags_123_api.py
|
|
||||||
petstore_api/api/pet_api.py
|
|
||||||
petstore_api/api/store_api.py
|
|
||||||
petstore_api/api/user_api.py
|
|
||||||
petstore_api/models/__init__.py
|
|
||||||
petstore_api/models/additional_properties_class.py
|
|
||||||
petstore_api/models/all_of_with_single_ref.py
|
|
||||||
petstore_api/models/animal.py
|
|
||||||
petstore_api/models/any_of_color.py
|
|
||||||
petstore_api/models/any_of_pig.py
|
|
||||||
petstore_api/models/api_response.py
|
|
||||||
petstore_api/models/array_of_array_of_number_only.py
|
|
||||||
petstore_api/models/array_of_number_only.py
|
|
||||||
petstore_api/models/array_test.py
|
|
||||||
petstore_api/models/basque_pig.py
|
|
||||||
petstore_api/models/capitalization.py
|
|
||||||
petstore_api/models/cat.py
|
|
||||||
petstore_api/models/cat_all_of.py
|
|
||||||
petstore_api/models/category.py
|
|
||||||
petstore_api/models/circular_reference_model.py
|
|
||||||
petstore_api/models/class_model.py
|
|
||||||
petstore_api/models/client.py
|
|
||||||
petstore_api/models/color.py
|
|
||||||
petstore_api/models/danish_pig.py
|
|
||||||
petstore_api/models/deprecated_object.py
|
|
||||||
petstore_api/models/dog.py
|
|
||||||
petstore_api/models/dog_all_of.py
|
|
||||||
petstore_api/models/dummy_model.py
|
|
||||||
petstore_api/models/enum_arrays.py
|
|
||||||
petstore_api/models/enum_class.py
|
|
||||||
petstore_api/models/enum_test.py
|
|
||||||
petstore_api/models/file.py
|
|
||||||
petstore_api/models/file_schema_test_class.py
|
|
||||||
petstore_api/models/first_ref.py
|
|
||||||
petstore_api/models/foo.py
|
|
||||||
petstore_api/models/foo_get_default_response.py
|
|
||||||
petstore_api/models/format_test.py
|
|
||||||
petstore_api/models/has_only_read_only.py
|
|
||||||
petstore_api/models/health_check_result.py
|
|
||||||
petstore_api/models/inner_dict_with_property.py
|
|
||||||
petstore_api/models/list.py
|
|
||||||
petstore_api/models/map_test.py
|
|
||||||
petstore_api/models/mixed_properties_and_additional_properties_class.py
|
|
||||||
petstore_api/models/model200_response.py
|
|
||||||
petstore_api/models/model_return.py
|
|
||||||
petstore_api/models/name.py
|
|
||||||
petstore_api/models/nullable_class.py
|
|
||||||
petstore_api/models/number_only.py
|
|
||||||
petstore_api/models/object_with_deprecated_fields.py
|
|
||||||
petstore_api/models/order.py
|
|
||||||
petstore_api/models/outer_composite.py
|
|
||||||
petstore_api/models/outer_enum.py
|
|
||||||
petstore_api/models/outer_enum_default_value.py
|
|
||||||
petstore_api/models/outer_enum_integer.py
|
|
||||||
petstore_api/models/outer_enum_integer_default_value.py
|
|
||||||
petstore_api/models/outer_object_with_enum_property.py
|
|
||||||
petstore_api/models/parent.py
|
|
||||||
petstore_api/models/parent_with_optional_dict.py
|
|
||||||
petstore_api/models/pet.py
|
|
||||||
petstore_api/models/pig.py
|
|
||||||
petstore_api/models/read_only_first.py
|
|
||||||
petstore_api/models/second_ref.py
|
|
||||||
petstore_api/models/self_reference_model.py
|
|
||||||
petstore_api/models/single_ref_type.py
|
|
||||||
petstore_api/models/special_character_enum.py
|
|
||||||
petstore_api/models/special_model_name.py
|
|
||||||
petstore_api/models/special_name.py
|
|
||||||
petstore_api/models/tag.py
|
|
||||||
petstore_api/models/user.py
|
|
||||||
petstore_api/models/with_nested_one_of.py
|
|
||||||
test/test_additional_properties_class.py
|
|
||||||
test/test_all_of_with_single_ref.py
|
|
||||||
test/test_animal.py
|
|
||||||
test/test_another_fake_api.py
|
|
||||||
test/test_any_of_color.py
|
|
||||||
test/test_any_of_pig.py
|
|
||||||
test/test_api_response.py
|
|
||||||
test/test_array_of_array_of_number_only.py
|
|
||||||
test/test_array_of_number_only.py
|
|
||||||
test/test_array_test.py
|
|
||||||
test/test_basque_pig.py
|
|
||||||
test/test_capitalization.py
|
|
||||||
test/test_cat.py
|
|
||||||
test/test_cat_all_of.py
|
|
||||||
test/test_category.py
|
|
||||||
test/test_circular_reference_model.py
|
|
||||||
test/test_class_model.py
|
|
||||||
test/test_client.py
|
|
||||||
test/test_color.py
|
|
||||||
test/test_configuration.py
|
|
||||||
test/test_danish_pig.py
|
|
||||||
test/test_default_api.py
|
|
||||||
test/test_deprecated_object.py
|
|
||||||
test/test_dog.py
|
|
||||||
test/test_dog_all_of.py
|
|
||||||
test/test_dummy_model.py
|
|
||||||
test/test_enum_arrays.py
|
|
||||||
test/test_enum_class.py
|
|
||||||
test/test_enum_test.py
|
|
||||||
test/test_fake_api.py
|
|
||||||
test/test_fake_classname_tags123_api.py
|
|
||||||
test/test_fake_classname_tags_123_api.py
|
|
||||||
test/test_file.py
|
|
||||||
test/test_file_schema_test_class.py
|
|
||||||
test/test_first_ref.py
|
|
||||||
test/test_foo.py
|
|
||||||
test/test_foo_get_default_response.py
|
|
||||||
test/test_format_test.py
|
|
||||||
test/test_has_only_read_only.py
|
|
||||||
test/test_health_check_result.py
|
|
||||||
test/test_inner_dict_with_property.py
|
|
||||||
test/test_list.py
|
|
||||||
test/test_map_test.py
|
|
||||||
test/test_mixed_properties_and_additional_properties_class.py
|
|
||||||
test/test_model200_response.py
|
|
||||||
test/test_model_return.py
|
|
||||||
test/test_name.py
|
|
||||||
test/test_nullable_class.py
|
|
||||||
test/test_number_only.py
|
|
||||||
test/test_object_with_deprecated_fields.py
|
|
||||||
test/test_order.py
|
|
||||||
test/test_outer_composite.py
|
|
||||||
test/test_outer_enum.py
|
|
||||||
test/test_outer_enum_default_value.py
|
|
||||||
test/test_outer_enum_integer.py
|
|
||||||
test/test_outer_enum_integer_default_value.py
|
|
||||||
test/test_outer_object_with_enum_property.py
|
|
||||||
test/test_parent.py
|
|
||||||
test/test_parent_with_optional_dict.py
|
|
||||||
test/test_pet.py
|
|
||||||
test/test_pet_api.py
|
|
||||||
test/test_pig.py
|
|
||||||
test/test_read_only_first.py
|
|
||||||
test/test_second_ref.py
|
|
||||||
test/test_self_reference_model.py
|
|
||||||
test/test_single_ref_type.py
|
|
||||||
test/test_special_character_enum.py
|
|
||||||
test/test_special_model_name.py
|
|
||||||
test/test_special_name.py
|
|
||||||
test/test_store_api.py
|
|
||||||
test/test_tag.py
|
|
||||||
test/test_user.py
|
|
||||||
test/test_user_api.py
|
|
||||||
test/test_with_nested_one_of.py
|
|
||||||
tests/test_api_client.py
|
|
||||||
tests/test_api_exception.py
|
|
||||||
tests/test_api_validation.py
|
|
||||||
tests/test_configuration.py
|
|
||||||
tests/test_deserialization.py
|
|
||||||
tests/test_http_signature.py
|
|
||||||
tests/test_map_test.py
|
|
||||||
tests/test_model.py
|
|
||||||
tests/test_order_model.py
|
|
||||||
tests/test_pet_api.py
|
|
||||||
tests/test_pet_model.py
|
|
||||||
tests/test_store_api.py
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
urllib3>=1.25.3
|
|
||||||
python-dateutil
|
|
||||||
pem>=19.3.0
|
|
||||||
pycryptodome>=3.9.0
|
|
||||||
pydantic<2,>=1.10.5
|
|
||||||
aenum
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
petstore_api
|
|
||||||
@@ -1,349 +0,0 @@
|
|||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
import re # noqa: F401
|
|
||||||
import sys # noqa: F401
|
|
||||||
|
|
||||||
from petstore_api.model_utils import ( # noqa: F401
|
|
||||||
ApiTypeError,
|
|
||||||
ModelComposed,
|
|
||||||
ModelNormal,
|
|
||||||
ModelSimple,
|
|
||||||
cached_property,
|
|
||||||
change_keys_js_to_python,
|
|
||||||
convert_js_args_to_python_args,
|
|
||||||
date,
|
|
||||||
datetime,
|
|
||||||
file_type,
|
|
||||||
none_type,
|
|
||||||
validate_get_composed_info,
|
|
||||||
OpenApiModel
|
|
||||||
)
|
|
||||||
from petstore_api.exceptions import ApiAttributeError
|
|
||||||
|
|
||||||
|
|
||||||
def lazy_import():
|
|
||||||
from petstore_api.model.pig import Pig
|
|
||||||
from petstore_api.model.whale import Whale
|
|
||||||
from petstore_api.model.zebra import Zebra
|
|
||||||
globals()['Pig'] = Pig
|
|
||||||
globals()['Whale'] = Whale
|
|
||||||
globals()['Zebra'] = Zebra
|
|
||||||
|
|
||||||
|
|
||||||
class Mammal(ModelComposed):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
|
||||||
Ref: https://openapi-generator.tech
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
|
|
||||||
Attributes:
|
|
||||||
allowed_values (dict): The key is the tuple path to the attribute
|
|
||||||
and the for var_name this is (var_name,). The value is a dict
|
|
||||||
with a capitalized key describing the allowed value and an allowed
|
|
||||||
value. These dicts store the allowed enum values.
|
|
||||||
attribute_map (dict): The key is attribute name
|
|
||||||
and the value is json key in definition.
|
|
||||||
discriminator_value_class_map (dict): A dict to go from the discriminator
|
|
||||||
variable value to the discriminator class name.
|
|
||||||
validations (dict): The key is the tuple path to the attribute
|
|
||||||
and the for var_name this is (var_name,). The value is a dict
|
|
||||||
that stores validations for max_length, min_length, max_items,
|
|
||||||
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
|
||||||
inclusive_minimum, and regex.
|
|
||||||
additional_properties_type (tuple): A tuple of classes accepted
|
|
||||||
as additional properties values.
|
|
||||||
"""
|
|
||||||
|
|
||||||
allowed_values = {
|
|
||||||
('type',): {
|
|
||||||
'PLAINS': "plains",
|
|
||||||
'MOUNTAIN': "mountain",
|
|
||||||
'GREVYS': "grevys",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
validations = {
|
|
||||||
}
|
|
||||||
|
|
||||||
@cached_property
|
|
||||||
def additional_properties_type():
|
|
||||||
"""
|
|
||||||
This must be a method because a model may have properties that are
|
|
||||||
of type self, this must run after the class is loaded
|
|
||||||
"""
|
|
||||||
lazy_import()
|
|
||||||
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
|
|
||||||
|
|
||||||
_nullable = False
|
|
||||||
|
|
||||||
@cached_property
|
|
||||||
def openapi_types():
|
|
||||||
"""
|
|
||||||
This must be a method because a model may have properties that are
|
|
||||||
of type self, this must run after the class is loaded
|
|
||||||
|
|
||||||
Returns
|
|
||||||
openapi_types (dict): The key is attribute name
|
|
||||||
and the value is attribute type.
|
|
||||||
"""
|
|
||||||
lazy_import()
|
|
||||||
return {
|
|
||||||
'class_name': (str,), # noqa: E501
|
|
||||||
'has_baleen': (bool,), # noqa: E501
|
|
||||||
'has_teeth': (bool,), # noqa: E501
|
|
||||||
'type': (str,), # noqa: E501
|
|
||||||
}
|
|
||||||
|
|
||||||
@cached_property
|
|
||||||
def discriminator():
|
|
||||||
lazy_import()
|
|
||||||
val = {
|
|
||||||
'whale': Whale,
|
|
||||||
'zebra': Zebra,
|
|
||||||
'Pig': Pig,
|
|
||||||
}
|
|
||||||
if not val:
|
|
||||||
return None
|
|
||||||
return {'class_name': val}
|
|
||||||
|
|
||||||
attribute_map = {
|
|
||||||
'class_name': 'className', # noqa: E501
|
|
||||||
'has_baleen': 'hasBaleen', # noqa: E501
|
|
||||||
'has_teeth': 'hasTeeth', # noqa: E501
|
|
||||||
'type': 'type', # noqa: E501
|
|
||||||
}
|
|
||||||
|
|
||||||
read_only_vars = {
|
|
||||||
}
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
@convert_js_args_to_python_args
|
|
||||||
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
|
|
||||||
"""Mammal - a model defined in OpenAPI
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
class_name (str):
|
|
||||||
_check_type (bool): if True, values for parameters in openapi_types
|
|
||||||
will be type checked and a TypeError will be
|
|
||||||
raised if the wrong type is input.
|
|
||||||
Defaults to True
|
|
||||||
_path_to_item (tuple/list): This is a list of keys or values to
|
|
||||||
drill down to the model in received_data
|
|
||||||
when deserializing a response
|
|
||||||
_spec_property_naming (bool): True if the variable names in the input data
|
|
||||||
are serialized names, as specified in the OpenAPI document.
|
|
||||||
False if the variable names in the input data
|
|
||||||
are pythonic names, e.g. snake case (default)
|
|
||||||
_configuration (Configuration): the instance to use when
|
|
||||||
deserializing a file_type parameter.
|
|
||||||
If passed, type conversion is attempted
|
|
||||||
If omitted no type conversion is done.
|
|
||||||
_visited_composed_classes (tuple): This stores a tuple of
|
|
||||||
classes that we have traveled through so that
|
|
||||||
if we see that class again we will not use its
|
|
||||||
discriminator again.
|
|
||||||
When traveling through a discriminator, the
|
|
||||||
composed schema that is
|
|
||||||
is traveled through is added to this set.
|
|
||||||
For example if Animal has a discriminator
|
|
||||||
petType and we pass in "Dog", and the class Dog
|
|
||||||
allOf includes Animal, we move through Animal
|
|
||||||
once using the discriminator, and pick Dog.
|
|
||||||
Then in Dog, we will make an instance of the
|
|
||||||
Animal class but this time we won't travel
|
|
||||||
through its discriminator because we passed in
|
|
||||||
_visited_composed_classes = (Animal,)
|
|
||||||
has_baleen (bool): [optional] # noqa: E501
|
|
||||||
has_teeth (bool): [optional] # noqa: E501
|
|
||||||
type (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
_check_type = kwargs.pop('_check_type', True)
|
|
||||||
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
|
||||||
_path_to_item = kwargs.pop('_path_to_item', ())
|
|
||||||
_configuration = kwargs.pop('_configuration', None)
|
|
||||||
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
|
||||||
|
|
||||||
self = super(OpenApiModel, cls).__new__(cls)
|
|
||||||
|
|
||||||
if args:
|
|
||||||
for arg in args:
|
|
||||||
if isinstance(arg, dict):
|
|
||||||
kwargs.update(arg)
|
|
||||||
else:
|
|
||||||
raise ApiTypeError(
|
|
||||||
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
|
||||||
args,
|
|
||||||
self.__class__.__name__,
|
|
||||||
),
|
|
||||||
path_to_item=_path_to_item,
|
|
||||||
valid_classes=(self.__class__,),
|
|
||||||
)
|
|
||||||
|
|
||||||
self._data_store = {}
|
|
||||||
self._check_type = _check_type
|
|
||||||
self._spec_property_naming = _spec_property_naming
|
|
||||||
self._path_to_item = _path_to_item
|
|
||||||
self._configuration = _configuration
|
|
||||||
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
|
||||||
|
|
||||||
constant_args = {
|
|
||||||
'_check_type': _check_type,
|
|
||||||
'_path_to_item': _path_to_item,
|
|
||||||
'_spec_property_naming': _spec_property_naming,
|
|
||||||
'_configuration': _configuration,
|
|
||||||
'_visited_composed_classes': self._visited_composed_classes,
|
|
||||||
}
|
|
||||||
composed_info = validate_get_composed_info(
|
|
||||||
constant_args, kwargs, self)
|
|
||||||
self._composed_instances = composed_info[0]
|
|
||||||
self._var_name_to_model_instances = composed_info[1]
|
|
||||||
self._additional_properties_model_instances = composed_info[2]
|
|
||||||
discarded_args = composed_info[3]
|
|
||||||
|
|
||||||
for var_name, var_value in kwargs.items():
|
|
||||||
if var_name in discarded_args and \
|
|
||||||
self._configuration is not None and \
|
|
||||||
self._configuration.discard_unknown_keys and \
|
|
||||||
self._additional_properties_model_instances:
|
|
||||||
# discard variable.
|
|
||||||
continue
|
|
||||||
setattr(self, var_name, var_value)
|
|
||||||
|
|
||||||
return self
|
|
||||||
|
|
||||||
required_properties = set([
|
|
||||||
'_data_store',
|
|
||||||
'_check_type',
|
|
||||||
'_spec_property_naming',
|
|
||||||
'_path_to_item',
|
|
||||||
'_configuration',
|
|
||||||
'_visited_composed_classes',
|
|
||||||
'_composed_instances',
|
|
||||||
'_var_name_to_model_instances',
|
|
||||||
'_additional_properties_model_instances',
|
|
||||||
])
|
|
||||||
|
|
||||||
@convert_js_args_to_python_args
|
|
||||||
def __init__(self, *args, **kwargs): # noqa: E501
|
|
||||||
"""Mammal - a model defined in OpenAPI
|
|
||||||
|
|
||||||
Keyword Args:
|
|
||||||
class_name (str):
|
|
||||||
_check_type (bool): if True, values for parameters in openapi_types
|
|
||||||
will be type checked and a TypeError will be
|
|
||||||
raised if the wrong type is input.
|
|
||||||
Defaults to True
|
|
||||||
_path_to_item (tuple/list): This is a list of keys or values to
|
|
||||||
drill down to the model in received_data
|
|
||||||
when deserializing a response
|
|
||||||
_spec_property_naming (bool): True if the variable names in the input data
|
|
||||||
are serialized names, as specified in the OpenAPI document.
|
|
||||||
False if the variable names in the input data
|
|
||||||
are pythonic names, e.g. snake case (default)
|
|
||||||
_configuration (Configuration): the instance to use when
|
|
||||||
deserializing a file_type parameter.
|
|
||||||
If passed, type conversion is attempted
|
|
||||||
If omitted no type conversion is done.
|
|
||||||
_visited_composed_classes (tuple): This stores a tuple of
|
|
||||||
classes that we have traveled through so that
|
|
||||||
if we see that class again we will not use its
|
|
||||||
discriminator again.
|
|
||||||
When traveling through a discriminator, the
|
|
||||||
composed schema that is
|
|
||||||
is traveled through is added to this set.
|
|
||||||
For example if Animal has a discriminator
|
|
||||||
petType and we pass in "Dog", and the class Dog
|
|
||||||
allOf includes Animal, we move through Animal
|
|
||||||
once using the discriminator, and pick Dog.
|
|
||||||
Then in Dog, we will make an instance of the
|
|
||||||
Animal class but this time we won't travel
|
|
||||||
through its discriminator because we passed in
|
|
||||||
_visited_composed_classes = (Animal,)
|
|
||||||
has_baleen (bool): [optional] # noqa: E501
|
|
||||||
has_teeth (bool): [optional] # noqa: E501
|
|
||||||
type (str): [optional] # noqa: E501
|
|
||||||
"""
|
|
||||||
|
|
||||||
_check_type = kwargs.pop('_check_type', True)
|
|
||||||
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
|
||||||
_path_to_item = kwargs.pop('_path_to_item', ())
|
|
||||||
_configuration = kwargs.pop('_configuration', None)
|
|
||||||
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
|
||||||
|
|
||||||
if args:
|
|
||||||
for arg in args:
|
|
||||||
if isinstance(arg, dict):
|
|
||||||
kwargs.update(arg)
|
|
||||||
else:
|
|
||||||
raise ApiTypeError(
|
|
||||||
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
|
||||||
args,
|
|
||||||
self.__class__.__name__,
|
|
||||||
),
|
|
||||||
path_to_item=_path_to_item,
|
|
||||||
valid_classes=(self.__class__,),
|
|
||||||
)
|
|
||||||
|
|
||||||
self._data_store = {}
|
|
||||||
self._check_type = _check_type
|
|
||||||
self._spec_property_naming = _spec_property_naming
|
|
||||||
self._path_to_item = _path_to_item
|
|
||||||
self._configuration = _configuration
|
|
||||||
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
|
||||||
|
|
||||||
constant_args = {
|
|
||||||
'_check_type': _check_type,
|
|
||||||
'_path_to_item': _path_to_item,
|
|
||||||
'_spec_property_naming': _spec_property_naming,
|
|
||||||
'_configuration': _configuration,
|
|
||||||
'_visited_composed_classes': self._visited_composed_classes,
|
|
||||||
}
|
|
||||||
composed_info = validate_get_composed_info(
|
|
||||||
constant_args, kwargs, self)
|
|
||||||
self._composed_instances = composed_info[0]
|
|
||||||
self._var_name_to_model_instances = composed_info[1]
|
|
||||||
self._additional_properties_model_instances = composed_info[2]
|
|
||||||
discarded_args = composed_info[3]
|
|
||||||
|
|
||||||
for var_name, var_value in kwargs.items():
|
|
||||||
if var_name in discarded_args and \
|
|
||||||
self._configuration is not None and \
|
|
||||||
self._configuration.discard_unknown_keys and \
|
|
||||||
self._additional_properties_model_instances:
|
|
||||||
# discard variable.
|
|
||||||
continue
|
|
||||||
setattr(self, var_name, var_value)
|
|
||||||
if var_name in self.read_only_vars:
|
|
||||||
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
|
|
||||||
f"class with read only attributes.")
|
|
||||||
|
|
||||||
@cached_property
|
|
||||||
def _composed_schemas():
|
|
||||||
# we need this here to make our import statements work
|
|
||||||
# we must store _composed_schemas in here so the code is only run
|
|
||||||
# when we invoke this method. If we kept this at the class
|
|
||||||
# level we would get an error because the class level
|
|
||||||
# code would be run when this module is imported, and these composed
|
|
||||||
# classes don't exist yet because their module has not finished
|
|
||||||
# loading
|
|
||||||
lazy_import()
|
|
||||||
return {
|
|
||||||
'anyOf': [
|
|
||||||
],
|
|
||||||
'allOf': [
|
|
||||||
],
|
|
||||||
'oneOf': [
|
|
||||||
Pig,
|
|
||||||
Whale,
|
|
||||||
Zebra,
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
# List
|
|
||||||
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**var_123_list** | **str** | | [optional]
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```python
|
|
||||||
from petstore_api.models.list import List
|
|
||||||
|
|
||||||
# TODO update the JSON string below
|
|
||||||
json = "{}"
|
|
||||||
# create an instance of List from a JSON string
|
|
||||||
list_instance = List.from_json(json)
|
|
||||||
# print the JSON string representation of the object
|
|
||||||
print List.to_json()
|
|
||||||
|
|
||||||
# convert the object into a dict
|
|
||||||
list_dict = list_instance.to_dict()
|
|
||||||
# create an instance of List from a dict
|
|
||||||
list_form_dict = list.from_dict(list_dict)
|
|
||||||
```
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
import pprint
|
|
||||||
import re # noqa: F401
|
|
||||||
import json
|
|
||||||
|
|
||||||
|
|
||||||
from typing import Optional
|
|
||||||
from pydantic import BaseModel, Field, StrictStr
|
|
||||||
|
|
||||||
class List(BaseModel):
|
|
||||||
"""
|
|
||||||
List
|
|
||||||
"""
|
|
||||||
var_123_list: Optional[StrictStr] = Field(None, alias="123-list")
|
|
||||||
__properties = ["123-list"]
|
|
||||||
|
|
||||||
class Config:
|
|
||||||
"""Pydantic configuration"""
|
|
||||||
allow_population_by_field_name = True
|
|
||||||
validate_assignment = True
|
|
||||||
|
|
||||||
def to_str(self) -> str:
|
|
||||||
"""Returns the string representation of the model using alias"""
|
|
||||||
return pprint.pformat(self.dict(by_alias=True))
|
|
||||||
|
|
||||||
def to_json(self) -> str:
|
|
||||||
"""Returns the JSON representation of the model using alias"""
|
|
||||||
return json.dumps(self.to_dict())
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_json(cls, json_str: str) -> List:
|
|
||||||
"""Create an instance of List from a JSON string"""
|
|
||||||
return cls.from_dict(json.loads(json_str))
|
|
||||||
|
|
||||||
def to_dict(self):
|
|
||||||
"""Returns the dictionary representation of the model using alias"""
|
|
||||||
_dict = self.dict(by_alias=True,
|
|
||||||
exclude={
|
|
||||||
},
|
|
||||||
exclude_none=True)
|
|
||||||
return _dict
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, obj: dict) -> List:
|
|
||||||
"""Create an instance of List from a dict"""
|
|
||||||
if obj is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
if not isinstance(obj, dict):
|
|
||||||
return List.parse_obj(obj)
|
|
||||||
|
|
||||||
_obj = List.parse_obj({
|
|
||||||
"var_123_list": obj.get("123-list")
|
|
||||||
})
|
|
||||||
return _obj
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
import petstore_api
|
|
||||||
from petstore_api.models.list import List # noqa: E501
|
|
||||||
from petstore_api.rest import ApiException
|
|
||||||
|
|
||||||
class TestList(unittest.TestCase):
|
|
||||||
"""List unit test stubs"""
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def make_instance(self, include_optional):
|
|
||||||
"""Test List
|
|
||||||
include_option is a boolean, when False only required
|
|
||||||
params are included, when True both required and
|
|
||||||
optional params are included """
|
|
||||||
# model = petstore_api.models.list.List() # noqa: E501
|
|
||||||
if include_optional :
|
|
||||||
return List(
|
|
||||||
_123_list = ''
|
|
||||||
)
|
|
||||||
else :
|
|
||||||
return List(
|
|
||||||
)
|
|
||||||
|
|
||||||
def testList(self):
|
|
||||||
"""Test List"""
|
|
||||||
# inst_req_only = self.make_instance(include_optional=False)
|
|
||||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
# List
|
|
||||||
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**var_123_list** | **str** | | [optional]
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```python
|
|
||||||
from petstore_api.models.list import List
|
|
||||||
|
|
||||||
# TODO update the JSON string below
|
|
||||||
json = "{}"
|
|
||||||
# create an instance of List from a JSON string
|
|
||||||
list_instance = List.from_json(json)
|
|
||||||
# print the JSON string representation of the object
|
|
||||||
print List.to_json()
|
|
||||||
|
|
||||||
# convert the object into a dict
|
|
||||||
list_dict = list_instance.to_dict()
|
|
||||||
# create an instance of List from a dict
|
|
||||||
list_form_dict = list.from_dict(list_dict)
|
|
||||||
```
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import re # noqa: F401
|
|
||||||
|
|
||||||
from petstore_api.api_client import ApiClient
|
|
||||||
from petstore_api.exceptions import ( # noqa: F401
|
|
||||||
ApiTypeError,
|
|
||||||
ApiValueError
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class FakeClassnameTags123Api(object):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
||||||
Ref: https://openapi-generator.tech
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, api_client=None):
|
|
||||||
if api_client is None:
|
|
||||||
api_client = ApiClient()
|
|
||||||
self.api_client = api_client
|
|
||||||
|
|
||||||
def test_classname(self, client, **kwargs): # noqa: E501
|
|
||||||
"""To test class name in snake case # noqa: E501
|
|
||||||
|
|
||||||
To test class name in snake case # noqa: E501
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
|
||||||
asynchronous HTTP request, please pass async_req=True
|
|
||||||
|
|
||||||
>>> thread = api.test_classname(client, async_req=True)
|
|
||||||
>>> result = thread.get()
|
|
||||||
|
|
||||||
:param client: client model (required)
|
|
||||||
:type client: Client
|
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
|
||||||
:type async_req: bool, optional
|
|
||||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
||||||
be returned without reading/decoding response
|
|
||||||
data. Default is True.
|
|
||||||
:type _preload_content: bool, optional
|
|
||||||
:param _request_timeout: timeout setting for this request. If one
|
|
||||||
number provided, it will be total request
|
|
||||||
timeout. It can also be a pair (tuple) of
|
|
||||||
(connection, read) timeouts.
|
|
||||||
:return: Returns the result object.
|
|
||||||
If the method is called asynchronously,
|
|
||||||
returns the request thread.
|
|
||||||
:rtype: Client
|
|
||||||
"""
|
|
||||||
kwargs['_return_http_data_only'] = True
|
|
||||||
return self.test_classname_with_http_info(client, **kwargs) # noqa: E501
|
|
||||||
|
|
||||||
def test_classname_with_http_info(self, client, **kwargs): # noqa: E501
|
|
||||||
"""To test class name in snake case # noqa: E501
|
|
||||||
|
|
||||||
To test class name in snake case # noqa: E501
|
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
|
||||||
asynchronous HTTP request, please pass async_req=True
|
|
||||||
|
|
||||||
>>> thread = api.test_classname_with_http_info(client, async_req=True)
|
|
||||||
>>> result = thread.get()
|
|
||||||
|
|
||||||
:param client: client model (required)
|
|
||||||
:type client: Client
|
|
||||||
:param async_req: Whether to execute the request asynchronously.
|
|
||||||
:type async_req: bool, optional
|
|
||||||
:param _return_http_data_only: response data without head status code
|
|
||||||
and headers
|
|
||||||
:type _return_http_data_only: bool, optional
|
|
||||||
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
||||||
be returned without reading/decoding response
|
|
||||||
data. Default is True.
|
|
||||||
:type _preload_content: bool, optional
|
|
||||||
:param _request_timeout: timeout setting for this request. If one
|
|
||||||
number provided, it will be total request
|
|
||||||
timeout. It can also be a pair (tuple) of
|
|
||||||
(connection, read) timeouts.
|
|
||||||
:param _request_auth: set to override the auth_settings for an a single
|
|
||||||
request; this effectively ignores the authentication
|
|
||||||
in the spec for a single request.
|
|
||||||
:type _request_auth: dict, optional
|
|
||||||
:type _content_type: string, optional: force content-type for the request
|
|
||||||
:return: Returns the result object.
|
|
||||||
If the method is called asynchronously,
|
|
||||||
returns the request thread.
|
|
||||||
:rtype: tuple(Client, status_code(int), headers(HTTPHeaderDict))
|
|
||||||
"""
|
|
||||||
|
|
||||||
local_var_params = locals()
|
|
||||||
|
|
||||||
all_params = [
|
|
||||||
'client'
|
|
||||||
]
|
|
||||||
all_params.extend(
|
|
||||||
[
|
|
||||||
'async_req',
|
|
||||||
'_return_http_data_only',
|
|
||||||
'_preload_content',
|
|
||||||
'_request_timeout',
|
|
||||||
'_request_auth',
|
|
||||||
'_content_type',
|
|
||||||
'_headers'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
for key, val in local_var_params['kwargs'].items():
|
|
||||||
if key not in all_params:
|
|
||||||
raise ApiTypeError(
|
|
||||||
"Got an unexpected keyword argument '%s'"
|
|
||||||
" to method test_classname" % key
|
|
||||||
)
|
|
||||||
local_var_params[key] = val
|
|
||||||
del local_var_params['kwargs']
|
|
||||||
# verify the required parameter 'client' is set
|
|
||||||
if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501
|
|
||||||
local_var_params['client'] is None): # noqa: E501
|
|
||||||
raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501
|
|
||||||
|
|
||||||
collection_formats = {}
|
|
||||||
|
|
||||||
path_params = {}
|
|
||||||
|
|
||||||
query_params = []
|
|
||||||
|
|
||||||
header_params = dict(local_var_params.get('_headers', {}))
|
|
||||||
|
|
||||||
form_params = []
|
|
||||||
local_var_files = {}
|
|
||||||
|
|
||||||
body_params = None
|
|
||||||
if 'client' in local_var_params:
|
|
||||||
body_params = local_var_params['client']
|
|
||||||
# HTTP header `Accept`
|
|
||||||
header_params['Accept'] = self.api_client.select_header_accept(
|
|
||||||
['application/json']) # noqa: E501
|
|
||||||
|
|
||||||
# HTTP header `Content-Type`
|
|
||||||
header_params['Content-Type'] = local_var_params.get('_content_type',
|
|
||||||
self.api_client.select_header_content_type(
|
|
||||||
['application/json'],
|
|
||||||
'PATCH', body_params)) # noqa: E501
|
|
||||||
|
|
||||||
# Authentication setting
|
|
||||||
auth_settings = ['api_key_query'] # noqa: E501
|
|
||||||
|
|
||||||
response_types_map = {
|
|
||||||
200: "Client",
|
|
||||||
}
|
|
||||||
|
|
||||||
return self.api_client.call_api(
|
|
||||||
'/fake_classname_test', 'PATCH',
|
|
||||||
path_params,
|
|
||||||
query_params,
|
|
||||||
header_params,
|
|
||||||
body=body_params,
|
|
||||||
post_params=form_params,
|
|
||||||
files=local_var_files,
|
|
||||||
response_types_map=response_types_map,
|
|
||||||
auth_settings=auth_settings,
|
|
||||||
async_req=local_var_params.get('async_req'),
|
|
||||||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
||||||
_preload_content=local_var_params.get('_preload_content', True),
|
|
||||||
_request_timeout=local_var_params.get('_request_timeout'),
|
|
||||||
collection_formats=collection_formats,
|
|
||||||
_request_auth=local_var_params.get('_request_auth'))
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
import pprint
|
|
||||||
import re # noqa: F401
|
|
||||||
import json
|
|
||||||
|
|
||||||
|
|
||||||
from typing import Any, Dict, Optional
|
|
||||||
from pydantic import BaseModel, Field, StrictStr
|
|
||||||
|
|
||||||
class List(BaseModel):
|
|
||||||
"""
|
|
||||||
List
|
|
||||||
"""
|
|
||||||
var_123_list: Optional[StrictStr] = Field(None, alias="123-list")
|
|
||||||
additional_properties: Dict[str, Any] = {}
|
|
||||||
__properties = ["123-list"]
|
|
||||||
|
|
||||||
class Config:
|
|
||||||
"""Pydantic configuration"""
|
|
||||||
allow_population_by_field_name = True
|
|
||||||
validate_assignment = True
|
|
||||||
|
|
||||||
def to_str(self) -> str:
|
|
||||||
"""Returns the string representation of the model using alias"""
|
|
||||||
return pprint.pformat(self.dict(by_alias=True))
|
|
||||||
|
|
||||||
def to_json(self) -> str:
|
|
||||||
"""Returns the JSON representation of the model using alias"""
|
|
||||||
return json.dumps(self.to_dict())
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_json(cls, json_str: str) -> List:
|
|
||||||
"""Create an instance of List from a JSON string"""
|
|
||||||
return cls.from_dict(json.loads(json_str))
|
|
||||||
|
|
||||||
def to_dict(self):
|
|
||||||
"""Returns the dictionary representation of the model using alias"""
|
|
||||||
_dict = self.dict(by_alias=True,
|
|
||||||
exclude={
|
|
||||||
"additional_properties"
|
|
||||||
},
|
|
||||||
exclude_none=True)
|
|
||||||
# puts key-value pairs in additional_properties in the top level
|
|
||||||
if self.additional_properties is not None:
|
|
||||||
for _key, _value in self.additional_properties.items():
|
|
||||||
_dict[_key] = _value
|
|
||||||
|
|
||||||
return _dict
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, obj: dict) -> List:
|
|
||||||
"""Create an instance of List from a dict"""
|
|
||||||
if obj is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
if not isinstance(obj, dict):
|
|
||||||
return List.parse_obj(obj)
|
|
||||||
|
|
||||||
_obj = List.parse_obj({
|
|
||||||
"var_123_list": obj.get("123-list")
|
|
||||||
})
|
|
||||||
# store additional fields in additional_properties
|
|
||||||
for _key in obj.keys():
|
|
||||||
if _key not in cls.__properties:
|
|
||||||
_obj.additional_properties[_key] = obj.get(_key)
|
|
||||||
|
|
||||||
return _obj
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
import petstore_api
|
|
||||||
from petstore_api import Configuration # noqa: E501
|
|
||||||
from petstore_api.rest import ApiException
|
|
||||||
|
|
||||||
|
|
||||||
class TestConfiguration(unittest.TestCase):
|
|
||||||
"""Configuration unit test stubs"""
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
self.config= Configuration()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_configuration(self):
|
|
||||||
"""Test configuration
|
|
||||||
|
|
||||||
Test host settings # noqa: E501
|
|
||||||
"""
|
|
||||||
host_settings = self.config.get_host_settings()
|
|
||||||
|
|
||||||
self.assertEqual('http://{server}.swagger.io:{port}/v2', host_settings[0]['url'])
|
|
||||||
self.assertEqual('petstore', host_settings[0]['variables']['server']['default_value'])
|
|
||||||
|
|
||||||
self.assertEqual('https://localhost:8080/{version}', host_settings[1]['url'])
|
|
||||||
self.assertEqual('v2', host_settings[1]['variables']['version']['default_value'])
|
|
||||||
|
|
||||||
def test_get_host_from_settings(self):
|
|
||||||
""" Test get_host_from_settings
|
|
||||||
|
|
||||||
Test get URL from host settings
|
|
||||||
"""
|
|
||||||
self.assertEqual("http://petstore.swagger.io:80/v2", self.config.get_host_from_settings(0))
|
|
||||||
self.assertEqual("http://petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'port': '8080'}))
|
|
||||||
self.assertEqual("http://dev-petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'server': 'dev-petstore', 'port': '8080'}))
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -3,32 +3,30 @@
|
|||||||
"""
|
"""
|
||||||
OpenAPI Petstore
|
OpenAPI Petstore
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
The version of the OpenAPI document: 1.0.0
|
||||||
Generated by: https://openapi-generator.tech
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||||
"""
|
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
""" # noqa: E501
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import petstore_api
|
from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api # noqa: E501
|
||||||
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
|
|
||||||
from petstore_api.rest import ApiException
|
|
||||||
|
|
||||||
|
|
||||||
class TestFakeClassnameTags123Api(unittest.TestCase):
|
class TestFakeClassnameTags123Api(unittest.TestCase):
|
||||||
"""FakeClassnameTags123Api unit test stubs"""
|
"""FakeClassnameTags123Api unit test stubs"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self) -> None:
|
||||||
self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
|
self.api = FakeClassnameTags123Api() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_test_classname(self):
|
def test_test_classname(self) -> None:
|
||||||
"""Test case for test_classname
|
"""Test case for test_classname
|
||||||
|
|
||||||
To test class name in snake case # noqa: E501
|
To test class name in snake case # noqa: E501
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
import petstore_api
|
|
||||||
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501
|
|
||||||
from petstore_api.rest import ApiException
|
|
||||||
|
|
||||||
|
|
||||||
class TestFakeClassnameTags123Api(unittest.TestCase):
|
|
||||||
"""FakeClassnameTags123Api unit test stubs"""
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_test_classname(self):
|
|
||||||
"""Test case for test_classname
|
|
||||||
|
|
||||||
To test class name in snake case # noqa: E501
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
import petstore_api
|
|
||||||
from petstore_api.models.list import List # noqa: E501
|
|
||||||
from petstore_api.rest import ApiException
|
|
||||||
|
|
||||||
class TestList(unittest.TestCase):
|
|
||||||
"""List unit test stubs"""
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def make_instance(self, include_optional):
|
|
||||||
"""Test List
|
|
||||||
include_option is a boolean, when False only required
|
|
||||||
params are included, when True both required and
|
|
||||||
optional params are included """
|
|
||||||
# model = petstore_api.models.list.List() # noqa: E501
|
|
||||||
if include_optional :
|
|
||||||
return List(
|
|
||||||
_123_list = ''
|
|
||||||
)
|
|
||||||
else :
|
|
||||||
return List(
|
|
||||||
)
|
|
||||||
|
|
||||||
def testList(self):
|
|
||||||
"""Test List"""
|
|
||||||
inst_req_only = self.make_instance(include_optional=False)
|
|
||||||
inst_req_and_optional = self.make_instance(include_optional=True)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -19,7 +19,7 @@ class TestConfiguration(unittest.TestCase):
|
|||||||
"""Animal unit test stubs"""
|
"""Animal unit test stubs"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
pass
|
self.config = petstore_api.Configuration()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
# reset Configuration
|
# reset Configuration
|
||||||
@@ -57,6 +57,24 @@ class TestConfiguration(unittest.TestCase):
|
|||||||
def testAccessTokenWhenConstructingConfiguration(self):
|
def testAccessTokenWhenConstructingConfiguration(self):
|
||||||
c1 = petstore_api.Configuration(access_token="12345")
|
c1 = petstore_api.Configuration(access_token="12345")
|
||||||
self.assertEqual(c1.access_token, "12345")
|
self.assertEqual(c1.access_token, "12345")
|
||||||
|
|
||||||
|
def test_get_host_settings(self):
|
||||||
|
host_settings = self.config.get_host_settings()
|
||||||
|
|
||||||
|
self.assertEqual('http://{server}.swagger.io:{port}/v2', host_settings[0]['url'])
|
||||||
|
self.assertEqual('petstore', host_settings[0]['variables']['server']['default_value'])
|
||||||
|
|
||||||
|
self.assertEqual('https://localhost:8080/{version}', host_settings[1]['url'])
|
||||||
|
self.assertEqual('v2', host_settings[1]['variables']['version']['default_value'])
|
||||||
|
|
||||||
|
def test_get_host_from_settings(self):
|
||||||
|
""" Test get_host_from_settings
|
||||||
|
|
||||||
|
Test get URL from host settings
|
||||||
|
"""
|
||||||
|
self.assertEqual("http://petstore.swagger.io:80/v2", self.config.get_host_from_settings(0))
|
||||||
|
self.assertEqual("http://petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'port': '8080'}))
|
||||||
|
self.assertEqual("http://dev-petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'server': 'dev-petstore', 'port': '8080'}))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
# List
|
|
||||||
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**var_123_list** | **str** | | [optional]
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```python
|
|
||||||
from petstore_api.models.list import List
|
|
||||||
|
|
||||||
# TODO update the JSON string below
|
|
||||||
json = "{}"
|
|
||||||
# create an instance of List from a JSON string
|
|
||||||
list_instance = List.from_json(json)
|
|
||||||
# print the JSON string representation of the object
|
|
||||||
print List.to_json()
|
|
||||||
|
|
||||||
# convert the object into a dict
|
|
||||||
list_dict = list_instance.to_dict()
|
|
||||||
# create an instance of List from a dict
|
|
||||||
list_form_dict = list.from_dict(list_dict)
|
|
||||||
```
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
"""
|
|
||||||
OpenAPI Petstore
|
|
||||||
|
|
||||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
import petstore_api
|
|
||||||
from petstore_api import Configuration # noqa: E501
|
|
||||||
from petstore_api.rest import ApiException
|
|
||||||
|
|
||||||
|
|
||||||
class TestConfiguration(unittest.TestCase):
|
|
||||||
"""Configuration unit test stubs"""
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
self.config= Configuration()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_configuration(self):
|
|
||||||
"""Test configuration
|
|
||||||
|
|
||||||
Test host settings # noqa: E501
|
|
||||||
"""
|
|
||||||
host_settings = self.config.get_host_settings()
|
|
||||||
|
|
||||||
self.assertEqual('http://{server}.swagger.io:{port}/v2', host_settings[0]['url'])
|
|
||||||
self.assertEqual('petstore', host_settings[0]['variables']['server']['default_value'])
|
|
||||||
|
|
||||||
self.assertEqual('https://localhost:8080/{version}', host_settings[1]['url'])
|
|
||||||
self.assertEqual('v2', host_settings[1]['variables']['version']['default_value'])
|
|
||||||
|
|
||||||
def test_get_host_from_settings(self):
|
|
||||||
""" Test get_host_from_settings
|
|
||||||
|
|
||||||
Test get URL from host settings
|
|
||||||
"""
|
|
||||||
self.assertEqual("http://petstore.swagger.io:80/v2", self.config.get_host_from_settings(0))
|
|
||||||
self.assertEqual("http://petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'port': '8080'}))
|
|
||||||
self.assertEqual("http://dev-petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'server': 'dev-petstore', 'port': '8080'}))
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -19,7 +19,7 @@ class TestConfiguration(unittest.TestCase):
|
|||||||
"""Animal unit test stubs"""
|
"""Animal unit test stubs"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
pass
|
self.config = petstore_api.Configuration()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
# reset Configuration
|
# reset Configuration
|
||||||
@@ -58,5 +58,23 @@ class TestConfiguration(unittest.TestCase):
|
|||||||
c1 = petstore_api.Configuration(access_token="12345")
|
c1 = petstore_api.Configuration(access_token="12345")
|
||||||
self.assertEqual(c1.access_token, "12345")
|
self.assertEqual(c1.access_token, "12345")
|
||||||
|
|
||||||
|
def test_get_host_settings(self):
|
||||||
|
host_settings = self.config.get_host_settings()
|
||||||
|
|
||||||
|
self.assertEqual('http://{server}.swagger.io:{port}/v2', host_settings[0]['url'])
|
||||||
|
self.assertEqual('petstore', host_settings[0]['variables']['server']['default_value'])
|
||||||
|
|
||||||
|
self.assertEqual('https://localhost:8080/{version}', host_settings[1]['url'])
|
||||||
|
self.assertEqual('v2', host_settings[1]['variables']['version']['default_value'])
|
||||||
|
|
||||||
|
def test_get_host_from_settings(self):
|
||||||
|
""" Test get_host_from_settings
|
||||||
|
|
||||||
|
Test get URL from host settings
|
||||||
|
"""
|
||||||
|
self.assertEqual("http://petstore.swagger.io:80/v2", self.config.get_host_from_settings(0))
|
||||||
|
self.assertEqual("http://petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'port': '8080'}))
|
||||||
|
self.assertEqual("http://dev-petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'server': 'dev-petstore', 'port': '8080'}))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
.travis.yaml
|
|
||||||
.openapi-generator-ignore
|
|
||||||
README.md
|
|
||||||
tox.ini
|
|
||||||
git_push.sh
|
|
||||||
test-requirements.txt
|
|
||||||
setup.py
|
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
|
||||||
__pycache__/
|
|
||||||
*.py[cod]
|
|
||||||
*$py.class
|
|
||||||
|
|
||||||
# C extensions
|
|
||||||
*.so
|
|
||||||
|
|
||||||
# Distribution / packaging
|
|
||||||
.Python
|
|
||||||
env/
|
|
||||||
build/
|
|
||||||
develop-eggs/
|
|
||||||
dist/
|
|
||||||
downloads/
|
|
||||||
eggs/
|
|
||||||
.eggs/
|
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
parts/
|
|
||||||
sdist/
|
|
||||||
var/
|
|
||||||
*.egg-info/
|
|
||||||
.installed.cfg
|
|
||||||
*.egg
|
|
||||||
|
|
||||||
# PyInstaller
|
|
||||||
# Usually these files are written by a python script from a template
|
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
||||||
*.manifest
|
|
||||||
*.spec
|
|
||||||
|
|
||||||
# Installer logs
|
|
||||||
pip-log.txt
|
|
||||||
pip-delete-this-directory.txt
|
|
||||||
|
|
||||||
# Unit test / coverage reports
|
|
||||||
htmlcov/
|
|
||||||
.tox/
|
|
||||||
.coverage
|
|
||||||
.coverage.*
|
|
||||||
.cache
|
|
||||||
nosetests.xml
|
|
||||||
coverage.xml
|
|
||||||
*,cover
|
|
||||||
.hypothesis/
|
|
||||||
venv/
|
|
||||||
.python-version
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
*.mo
|
|
||||||
*.pot
|
|
||||||
|
|
||||||
# Django stuff:
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# Sphinx documentation
|
|
||||||
docs/_build/
|
|
||||||
|
|
||||||
# PyBuilder
|
|
||||||
target/
|
|
||||||
|
|
||||||
#Ipython Notebook
|
|
||||||
.ipynb_checkpoints
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
# Byte-compiled / optimized / DLL files
|
|
||||||
__pycache__/
|
|
||||||
*.py[cod]
|
|
||||||
*$py.class
|
|
||||||
|
|
||||||
# C extensions
|
|
||||||
*.so
|
|
||||||
|
|
||||||
# Distribution / packaging
|
|
||||||
.Python
|
|
||||||
env/
|
|
||||||
build/
|
|
||||||
develop-eggs/
|
|
||||||
dist/
|
|
||||||
downloads/
|
|
||||||
eggs/
|
|
||||||
.eggs/
|
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
parts/
|
|
||||||
sdist/
|
|
||||||
var/
|
|
||||||
*.egg-info/
|
|
||||||
.installed.cfg
|
|
||||||
*.egg
|
|
||||||
|
|
||||||
# PyInstaller
|
|
||||||
# Usually these files are written by a python script from a template
|
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
||||||
*.manifest
|
|
||||||
*.spec
|
|
||||||
|
|
||||||
# Installer logs
|
|
||||||
pip-log.txt
|
|
||||||
pip-delete-this-directory.txt
|
|
||||||
|
|
||||||
# Unit test / coverage reports
|
|
||||||
htmlcov/
|
|
||||||
.tox/
|
|
||||||
.coverage
|
|
||||||
.coverage.*
|
|
||||||
.cache
|
|
||||||
nosetests.xml
|
|
||||||
coverage.xml
|
|
||||||
*,cover
|
|
||||||
.hypothesis/
|
|
||||||
venv/
|
|
||||||
.venv/
|
|
||||||
.python-version
|
|
||||||
.pytest_cache
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
*.mo
|
|
||||||
*.pot
|
|
||||||
|
|
||||||
# Django stuff:
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# Sphinx documentation
|
|
||||||
docs/_build/
|
|
||||||
|
|
||||||
# PyBuilder
|
|
||||||
target/
|
|
||||||
|
|
||||||
#Ipython Notebook
|
|
||||||
.ipynb_checkpoints
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
# OpenAPI Generator Ignore
|
|
||||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
||||||
|
|
||||||
# Use this file to prevent files from being overwritten by the generator.
|
|
||||||
# The patterns follow closely to .gitignore or .dockerignore.
|
|
||||||
|
|
||||||
# As an example, the C# client generator defines ApiClient.cs.
|
|
||||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
||||||
#ApiClient.cs
|
|
||||||
|
|
||||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
||||||
#foo/*/qux
|
|
||||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
||||||
|
|
||||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
||||||
#foo/**/qux
|
|
||||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
||||||
|
|
||||||
# You can also negate patterns with an exclamation (!).
|
|
||||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
||||||
#docs/*.md
|
|
||||||
# Then explicitly reverse the ignore rule for a single file:
|
|
||||||
#!docs/README.md
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
.dockerignore
|
|
||||||
.gitignore
|
|
||||||
.travis.yml
|
|
||||||
Dockerfile
|
|
||||||
README.md
|
|
||||||
git_push.sh
|
|
||||||
openapi_server/__init__.py
|
|
||||||
openapi_server/__main__.py
|
|
||||||
openapi_server/controllers/__init__.py
|
|
||||||
openapi_server/controllers/pet_controller.py
|
|
||||||
openapi_server/controllers/security_controller.py
|
|
||||||
openapi_server/controllers/store_controller.py
|
|
||||||
openapi_server/controllers/user_controller.py
|
|
||||||
openapi_server/encoder.py
|
|
||||||
openapi_server/models/__init__.py
|
|
||||||
openapi_server/models/api_response.py
|
|
||||||
openapi_server/models/base_model.py
|
|
||||||
openapi_server/models/category.py
|
|
||||||
openapi_server/models/order.py
|
|
||||||
openapi_server/models/pet.py
|
|
||||||
openapi_server/models/status_enum.py
|
|
||||||
openapi_server/models/tag.py
|
|
||||||
openapi_server/models/user.py
|
|
||||||
openapi_server/openapi/openapi.yaml
|
|
||||||
openapi_server/test/__init__.py
|
|
||||||
openapi_server/typing_utils.py
|
|
||||||
openapi_server/util.py
|
|
||||||
requirements.txt
|
|
||||||
setup.py
|
|
||||||
test-requirements.txt
|
|
||||||
tox.ini
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
7.0.0-SNAPSHOT
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# ref: https://docs.travis-ci.com/user/languages/python
|
|
||||||
language: python
|
|
||||||
python:
|
|
||||||
- "3.2"
|
|
||||||
- "3.3"
|
|
||||||
- "3.4"
|
|
||||||
- "3.5"
|
|
||||||
- "3.6"
|
|
||||||
- "3.7"
|
|
||||||
- "3.8"
|
|
||||||
# command to install dependencies
|
|
||||||
install: "pip install -r requirements.txt"
|
|
||||||
# command to run tests
|
|
||||||
script: nosetests
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
FROM python:3-alpine
|
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/app
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
COPY requirements.txt /usr/src/app/
|
|
||||||
|
|
||||||
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
||||||
|
|
||||||
COPY . /usr/src/app
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
ENTRYPOINT ["python3"]
|
|
||||||
|
|
||||||
CMD ["-m", "openapi_server"]
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
# OpenAPI generated server
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the
|
|
||||||
[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This
|
|
||||||
is an example of building a OpenAPI-enabled Flask server.
|
|
||||||
|
|
||||||
This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask.
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
Python 3.5.2+
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
To run the server, please execute the following from the root directory:
|
|
||||||
|
|
||||||
```
|
|
||||||
pip3 install -r requirements.txt
|
|
||||||
python3 -m openapi_server
|
|
||||||
```
|
|
||||||
|
|
||||||
and open your browser to here:
|
|
||||||
|
|
||||||
```
|
|
||||||
http://localhost:8080/v2/ui/
|
|
||||||
```
|
|
||||||
|
|
||||||
Your OpenAPI definition lives here:
|
|
||||||
|
|
||||||
```
|
|
||||||
http://localhost:8080/v2/openapi.json
|
|
||||||
```
|
|
||||||
|
|
||||||
To launch the integration tests, use tox:
|
|
||||||
```
|
|
||||||
sudo pip install tox
|
|
||||||
tox
|
|
||||||
```
|
|
||||||
|
|
||||||
## Running with Docker
|
|
||||||
|
|
||||||
To run the server on a Docker container, please execute the following from the root directory:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# building the image
|
|
||||||
docker build -t openapi_server .
|
|
||||||
|
|
||||||
# starting up a container
|
|
||||||
docker run -p 8080:8080 openapi_server
|
|
||||||
```
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
|
||||||
#
|
|
||||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
|
||||||
|
|
||||||
git_user_id=$1
|
|
||||||
git_repo_id=$2
|
|
||||||
release_note=$3
|
|
||||||
git_host=$4
|
|
||||||
|
|
||||||
if [ "$git_host" = "" ]; then
|
|
||||||
git_host="github.com"
|
|
||||||
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$git_user_id" = "" ]; then
|
|
||||||
git_user_id="GIT_USER_ID"
|
|
||||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$git_repo_id" = "" ]; then
|
|
||||||
git_repo_id="GIT_REPO_ID"
|
|
||||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$release_note" = "" ]; then
|
|
||||||
release_note="Minor update"
|
|
||||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Initialize the local directory as a Git repository
|
|
||||||
git init
|
|
||||||
|
|
||||||
# Adds the files in the local repository and stages them for commit.
|
|
||||||
git add .
|
|
||||||
|
|
||||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
|
||||||
git commit -m "$release_note"
|
|
||||||
|
|
||||||
# Sets the new remote
|
|
||||||
git_remote=$(git remote)
|
|
||||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
|
||||||
|
|
||||||
if [ "$GIT_TOKEN" = "" ]; then
|
|
||||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
|
||||||
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
|
||||||
else
|
|
||||||
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
git pull origin master
|
|
||||||
|
|
||||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
|
||||||
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
|
||||||
git push origin master 2>&1 | grep -v 'To https'
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import connexion
|
|
||||||
|
|
||||||
from openapi_server import encoder
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
app = connexion.App(__name__, specification_dir='./openapi/')
|
|
||||||
app.app.json_encoder = encoder.JSONEncoder
|
|
||||||
app.add_api('openapi.yaml',
|
|
||||||
arguments={'title': 'OpenAPI Petstore'},
|
|
||||||
pythonic_params=True)
|
|
||||||
|
|
||||||
app.run(port=8080)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
import connexion
|
|
||||||
from typing import Dict
|
|
||||||
from typing import Tuple
|
|
||||||
from typing import Union
|
|
||||||
|
|
||||||
from openapi_server.models.api_response import ApiResponse # noqa: E501
|
|
||||||
from openapi_server.models.pet import Pet # noqa: E501
|
|
||||||
from openapi_server.models.pet_form import PetForm # noqa: E501
|
|
||||||
from openapi_server.models.status_enum import StatusEnum # noqa: E501
|
|
||||||
from openapi_server.models.upload_form import UploadForm # noqa: E501
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
def add_pet(pet): # noqa: E501
|
|
||||||
"""Add a new pet to the store
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param pet: Pet object that needs to be added to the store
|
|
||||||
:type pet: dict | bytes
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def delete_pet(pet_id, api_key=None): # noqa: E501
|
|
||||||
"""Deletes a pet
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param pet_id: Pet id to delete
|
|
||||||
:type pet_id: int
|
|
||||||
:param api_key:
|
|
||||||
:type api_key: str
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def find_pets_by_status(status): # noqa: E501
|
|
||||||
"""Finds Pets by status
|
|
||||||
|
|
||||||
Multiple status values can be provided with comma separated strings # noqa: E501
|
|
||||||
|
|
||||||
:param status: Status values that need to be considered for filter
|
|
||||||
:type status: List[str]
|
|
||||||
|
|
||||||
:rtype: Union[List[Pet], Tuple[List[Pet], int], Tuple[List[Pet], int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def find_pets_by_tags(tags): # noqa: E501
|
|
||||||
"""Finds Pets by tags
|
|
||||||
|
|
||||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
|
|
||||||
|
|
||||||
:param tags: Tags to filter by
|
|
||||||
:type tags: List[str]
|
|
||||||
|
|
||||||
:rtype: Union[List[Pet], Tuple[List[Pet], int], Tuple[List[Pet], int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def get_pet_by_id(pet_id): # noqa: E501
|
|
||||||
"""Find pet by ID
|
|
||||||
|
|
||||||
Returns a single pet # noqa: E501
|
|
||||||
|
|
||||||
:param pet_id: ID of pet to return
|
|
||||||
:type pet_id: int
|
|
||||||
|
|
||||||
:rtype: Union[Pet, Tuple[Pet, int], Tuple[Pet, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def update_pet(pet): # noqa: E501
|
|
||||||
"""Update an existing pet
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param pet: Pet object that needs to be added to the store
|
|
||||||
:type pet: dict | bytes
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
pet = Pet.from_dict(connexion.request.get_json()) # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def update_pet_status_with_enum(pet_id, status): # noqa: E501
|
|
||||||
"""Set the status of a pet in the store using an enum
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param pet_id: ID of pet to return
|
|
||||||
:type pet_id: int
|
|
||||||
:param status: The required status
|
|
||||||
:type status: dict | bytes
|
|
||||||
|
|
||||||
:rtype: Union[Pet, Tuple[Pet, int], Tuple[Pet, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
status = StatusEnum.from_dict(connexion.request.get_json()) # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def update_pet_with_form(pet_id, pet_form=None): # noqa: E501
|
|
||||||
"""Updates a pet in the store with form data
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param pet_id: ID of pet that needs to be updated
|
|
||||||
:type pet_id: int
|
|
||||||
:param pet_form:
|
|
||||||
:type pet_form: dict | bytes
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
pet_form = PetForm.from_dict(connexion.request.get_json()) # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def upload_file(pet_id, upload_form=None): # noqa: E501
|
|
||||||
"""uploads an image
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param pet_id: ID of pet to update
|
|
||||||
:type pet_id: int
|
|
||||||
:param upload_form:
|
|
||||||
:type upload_form: dict | bytes
|
|
||||||
|
|
||||||
:rtype: Union[ApiResponse, Tuple[ApiResponse, int], Tuple[ApiResponse, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
upload_form = UploadForm.from_dict(connexion.request.get_json()) # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
from typing import List
|
|
||||||
|
|
||||||
|
|
||||||
def info_from_petstore_auth(token):
|
|
||||||
"""
|
|
||||||
Validate and decode token.
|
|
||||||
Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
|
|
||||||
'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
|
|
||||||
'scope' or 'scopes' will be passed to scope validation function.
|
|
||||||
|
|
||||||
:param token Token provided by Authorization header
|
|
||||||
:type token: str
|
|
||||||
:return: Decoded token information or None if token is invalid
|
|
||||||
:rtype: dict | None
|
|
||||||
"""
|
|
||||||
return {'scopes': ['read:pets', 'write:pets'], 'uid': 'user_id'}
|
|
||||||
|
|
||||||
|
|
||||||
def validate_scope_petstore_auth(required_scopes, token_scopes):
|
|
||||||
"""
|
|
||||||
Validate required scopes are included in token scope
|
|
||||||
|
|
||||||
:param required_scopes Required scope to access called API
|
|
||||||
:type required_scopes: List[str]
|
|
||||||
:param token_scopes Scope present in token
|
|
||||||
:type token_scopes: List[str]
|
|
||||||
:return: True if access to called API is allowed
|
|
||||||
:rtype: bool
|
|
||||||
"""
|
|
||||||
return set(required_scopes).issubset(set(token_scopes))
|
|
||||||
|
|
||||||
|
|
||||||
def info_from_api_key(api_key, required_scopes):
|
|
||||||
"""
|
|
||||||
Check and retrieve authentication information from api_key.
|
|
||||||
Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
|
|
||||||
'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
|
|
||||||
|
|
||||||
:param api_key API key provided by Authorization header
|
|
||||||
:type api_key: str
|
|
||||||
:param required_scopes Always None. Used for other authentication method
|
|
||||||
:type required_scopes: None
|
|
||||||
:return: Information attached to provided api_key or None if api_key is invalid or does not allow access to called API
|
|
||||||
:rtype: dict | None
|
|
||||||
"""
|
|
||||||
return {'uid': 'user_id'}
|
|
||||||
|
|
||||||
|
|
||||||
def info_from_auth_cookie(api_key, required_scopes):
|
|
||||||
"""
|
|
||||||
Check and retrieve authentication information from api_key.
|
|
||||||
Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
|
|
||||||
'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
|
|
||||||
|
|
||||||
:param api_key API key provided by Authorization header
|
|
||||||
:type api_key: str
|
|
||||||
:param required_scopes Always None. Used for other authentication method
|
|
||||||
:type required_scopes: None
|
|
||||||
:return: Information attached to provided api_key or None if api_key is invalid or does not allow access to called API
|
|
||||||
:rtype: dict | None
|
|
||||||
"""
|
|
||||||
return {'uid': 'user_id'}
|
|
||||||
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import connexion
|
|
||||||
from typing import Dict
|
|
||||||
from typing import Tuple
|
|
||||||
from typing import Union
|
|
||||||
|
|
||||||
from openapi_server.models.order import Order # noqa: E501
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
def delete_order(order_id): # noqa: E501
|
|
||||||
"""Delete purchase order by ID
|
|
||||||
|
|
||||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
|
|
||||||
|
|
||||||
:param order_id: ID of the order that needs to be deleted
|
|
||||||
:type order_id: str
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def get_inventory(): # noqa: E501
|
|
||||||
"""Returns pet inventories by status
|
|
||||||
|
|
||||||
Returns a map of status codes to quantities # noqa: E501
|
|
||||||
|
|
||||||
|
|
||||||
:rtype: Union[Dict[str, int], Tuple[Dict[str, int], int], Tuple[Dict[str, int], int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def get_order_by_id(order_id): # noqa: E501
|
|
||||||
"""Find purchase order by ID
|
|
||||||
|
|
||||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions # noqa: E501
|
|
||||||
|
|
||||||
:param order_id: ID of pet that needs to be fetched
|
|
||||||
:type order_id: int
|
|
||||||
|
|
||||||
:rtype: Union[Order, Tuple[Order, int], Tuple[Order, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def place_order(order): # noqa: E501
|
|
||||||
"""Place an order for a pet
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param order: order placed for purchasing the pet
|
|
||||||
:type order: dict | bytes
|
|
||||||
|
|
||||||
:rtype: Union[Order, Tuple[Order, int], Tuple[Order, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
order = Order.from_dict(connexion.request.get_json()) # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
import connexion
|
|
||||||
from typing import Dict
|
|
||||||
from typing import Tuple
|
|
||||||
from typing import Union
|
|
||||||
|
|
||||||
from openapi_server.models.user import User # noqa: E501
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
def create_user(user): # noqa: E501
|
|
||||||
"""Create user
|
|
||||||
|
|
||||||
This can only be done by the logged in user. # noqa: E501
|
|
||||||
|
|
||||||
:param user: Created user object
|
|
||||||
:type user: dict | bytes
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
user = User.from_dict(connexion.request.get_json()) # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def create_users_with_array_input(user): # noqa: E501
|
|
||||||
"""Creates list of users with given input array
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param user: List of user objects
|
|
||||||
:type user: list | bytes
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
user = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def create_users_with_list_input(user): # noqa: E501
|
|
||||||
"""Creates list of users with given input array
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param user: List of user objects
|
|
||||||
:type user: list | bytes
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
user = [User.from_dict(d) for d in connexion.request.get_json()] # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def delete_user(username): # noqa: E501
|
|
||||||
"""Delete user
|
|
||||||
|
|
||||||
This can only be done by the logged in user. # noqa: E501
|
|
||||||
|
|
||||||
:param username: The name that needs to be deleted
|
|
||||||
:type username: str
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def get_user_by_name(username): # noqa: E501
|
|
||||||
"""Get user by user name
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param username: The name that needs to be fetched. Use user1 for testing.
|
|
||||||
:type username: str
|
|
||||||
|
|
||||||
:rtype: Union[User, Tuple[User, int], Tuple[User, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def login_user(username, password): # noqa: E501
|
|
||||||
"""Logs user into the system
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
:param username: The user name for login
|
|
||||||
:type username: str
|
|
||||||
:param password: The password for login in clear text
|
|
||||||
:type password: str
|
|
||||||
|
|
||||||
:rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def logout_user(): # noqa: E501
|
|
||||||
"""Logs out current logged in user session
|
|
||||||
|
|
||||||
# noqa: E501
|
|
||||||
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
|
|
||||||
def update_user(username, user): # noqa: E501
|
|
||||||
"""Updated user
|
|
||||||
|
|
||||||
This can only be done by the logged in user. # noqa: E501
|
|
||||||
|
|
||||||
:param username: name that need to be deleted
|
|
||||||
:type username: str
|
|
||||||
:param user: Updated user object
|
|
||||||
:type user: dict | bytes
|
|
||||||
|
|
||||||
:rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]]
|
|
||||||
"""
|
|
||||||
if connexion.request.is_json:
|
|
||||||
user = User.from_dict(connexion.request.get_json()) # noqa: E501
|
|
||||||
return 'do some magic!'
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
from connexion.apps.flask_app import FlaskJSONEncoder
|
|
||||||
|
|
||||||
from openapi_server.models.base_model import Model
|
|
||||||
|
|
||||||
|
|
||||||
class JSONEncoder(FlaskJSONEncoder):
|
|
||||||
include_nulls = False
|
|
||||||
|
|
||||||
def default(self, o):
|
|
||||||
if isinstance(o, Model):
|
|
||||||
dikt = {}
|
|
||||||
for attr in o.openapi_types:
|
|
||||||
value = getattr(o, attr)
|
|
||||||
if value is None and not self.include_nulls:
|
|
||||||
continue
|
|
||||||
attr = o.attribute_map[attr]
|
|
||||||
dikt[attr] = value
|
|
||||||
return dikt
|
|
||||||
return FlaskJSONEncoder.default(self, o)
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
# flake8: noqa
|
|
||||||
from __future__ import absolute_import
|
|
||||||
# import models into model package
|
|
||||||
from openapi_server.models.api_response import ApiResponse
|
|
||||||
from openapi_server.models.category import Category
|
|
||||||
from openapi_server.models.order import Order
|
|
||||||
from openapi_server.models.pet import Pet
|
|
||||||
from openapi_server.models.status_enum import StatusEnum
|
|
||||||
from openapi_server.models.tag import Tag
|
|
||||||
from openapi_server.models.user import User
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model import Model
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
class ApiResponse(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, code=None, type=None, message=None): # noqa: E501
|
|
||||||
"""ApiResponse - a model defined in OpenAPI
|
|
||||||
|
|
||||||
:param code: The code of this ApiResponse. # noqa: E501
|
|
||||||
:type code: int
|
|
||||||
:param type: The type of this ApiResponse. # noqa: E501
|
|
||||||
:type type: str
|
|
||||||
:param message: The message of this ApiResponse. # noqa: E501
|
|
||||||
:type message: str
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
'code': int,
|
|
||||||
'type': str,
|
|
||||||
'message': str
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
'code': 'code',
|
|
||||||
'type': 'type',
|
|
||||||
'message': 'message'
|
|
||||||
}
|
|
||||||
|
|
||||||
self._code = code
|
|
||||||
self._type = type
|
|
||||||
self._message = message
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'ApiResponse':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The ApiResponse of this ApiResponse. # noqa: E501
|
|
||||||
:rtype: ApiResponse
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def code(self):
|
|
||||||
"""Gets the code of this ApiResponse.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The code of this ApiResponse.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._code
|
|
||||||
|
|
||||||
@code.setter
|
|
||||||
def code(self, code):
|
|
||||||
"""Sets the code of this ApiResponse.
|
|
||||||
|
|
||||||
|
|
||||||
:param code: The code of this ApiResponse.
|
|
||||||
:type code: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._code = code
|
|
||||||
|
|
||||||
@property
|
|
||||||
def type(self):
|
|
||||||
"""Gets the type of this ApiResponse.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The type of this ApiResponse.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._type
|
|
||||||
|
|
||||||
@type.setter
|
|
||||||
def type(self, type):
|
|
||||||
"""Sets the type of this ApiResponse.
|
|
||||||
|
|
||||||
|
|
||||||
:param type: The type of this ApiResponse.
|
|
||||||
:type type: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._type = type
|
|
||||||
|
|
||||||
@property
|
|
||||||
def message(self):
|
|
||||||
"""Gets the message of this ApiResponse.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The message of this ApiResponse.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._message
|
|
||||||
|
|
||||||
@message.setter
|
|
||||||
def message(self, message):
|
|
||||||
"""Sets the message of this ApiResponse.
|
|
||||||
|
|
||||||
|
|
||||||
:param message: The message of this ApiResponse.
|
|
||||||
:type message: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._message = message
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
import pprint
|
|
||||||
|
|
||||||
import typing
|
|
||||||
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
T = typing.TypeVar('T')
|
|
||||||
|
|
||||||
|
|
||||||
class Model(object):
|
|
||||||
# openapiTypes: The key is attribute name and the
|
|
||||||
# value is attribute type.
|
|
||||||
openapi_types: typing.Dict[str, type] = {}
|
|
||||||
|
|
||||||
# attributeMap: The key is attribute name and the
|
|
||||||
# value is json key in definition.
|
|
||||||
attribute_map: typing.Dict[str, str] = {}
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls: typing.Type[T], dikt) -> T:
|
|
||||||
"""Returns the dict as a model"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
def to_dict(self):
|
|
||||||
"""Returns the model properties as a dict
|
|
||||||
|
|
||||||
:rtype: dict
|
|
||||||
"""
|
|
||||||
result = {}
|
|
||||||
|
|
||||||
for attr in self.openapi_types:
|
|
||||||
value = getattr(self, attr)
|
|
||||||
if isinstance(value, list):
|
|
||||||
result[attr] = list(map(
|
|
||||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
||||||
value
|
|
||||||
))
|
|
||||||
elif hasattr(value, "to_dict"):
|
|
||||||
result[attr] = value.to_dict()
|
|
||||||
elif isinstance(value, dict):
|
|
||||||
result[attr] = dict(map(
|
|
||||||
lambda item: (item[0], item[1].to_dict())
|
|
||||||
if hasattr(item[1], "to_dict") else item,
|
|
||||||
value.items()
|
|
||||||
))
|
|
||||||
else:
|
|
||||||
result[attr] = value
|
|
||||||
|
|
||||||
return result
|
|
||||||
|
|
||||||
def to_str(self):
|
|
||||||
"""Returns the string representation of the model
|
|
||||||
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return pprint.pformat(self.to_dict())
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
"""For `print` and `pprint`"""
|
|
||||||
return self.to_str()
|
|
||||||
|
|
||||||
def __eq__(self, other):
|
|
||||||
"""Returns true if both objects are equal"""
|
|
||||||
return self.__dict__ == other.__dict__
|
|
||||||
|
|
||||||
def __ne__(self, other):
|
|
||||||
"""Returns true if both objects are not equal"""
|
|
||||||
return not self == other
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model import Model
|
|
||||||
import re
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
import re # noqa: E501
|
|
||||||
|
|
||||||
class Category(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, id=None, name=None): # noqa: E501
|
|
||||||
"""Category - a model defined in OpenAPI
|
|
||||||
|
|
||||||
:param id: The id of this Category. # noqa: E501
|
|
||||||
:type id: int
|
|
||||||
:param name: The name of this Category. # noqa: E501
|
|
||||||
:type name: str
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
'id': int,
|
|
||||||
'name': str
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
'id': 'id',
|
|
||||||
'name': 'name'
|
|
||||||
}
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
self._name = name
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'Category':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The Category of this Category. # noqa: E501
|
|
||||||
:rtype: Category
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def id(self):
|
|
||||||
"""Gets the id of this Category.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The id of this Category.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._id
|
|
||||||
|
|
||||||
@id.setter
|
|
||||||
def id(self, id):
|
|
||||||
"""Sets the id of this Category.
|
|
||||||
|
|
||||||
|
|
||||||
:param id: The id of this Category.
|
|
||||||
:type id: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Gets the name of this Category.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The name of this Category.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._name
|
|
||||||
|
|
||||||
@name.setter
|
|
||||||
def name(self, name):
|
|
||||||
"""Sets the name of this Category.
|
|
||||||
|
|
||||||
|
|
||||||
:param name: The name of this Category.
|
|
||||||
:type name: str
|
|
||||||
"""
|
|
||||||
if name is not None and not re.search(r'^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$', name): # noqa: E501
|
|
||||||
raise ValueError("Invalid value for `name`, must be a follow pattern or equal to `/^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$/`") # noqa: E501
|
|
||||||
|
|
||||||
self._name = name
|
|
||||||
@@ -1,202 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model import Model
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
class Order(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501
|
|
||||||
"""Order - a model defined in OpenAPI
|
|
||||||
|
|
||||||
:param id: The id of this Order. # noqa: E501
|
|
||||||
:type id: int
|
|
||||||
:param pet_id: The pet_id of this Order. # noqa: E501
|
|
||||||
:type pet_id: int
|
|
||||||
:param quantity: The quantity of this Order. # noqa: E501
|
|
||||||
:type quantity: int
|
|
||||||
:param ship_date: The ship_date of this Order. # noqa: E501
|
|
||||||
:type ship_date: datetime
|
|
||||||
:param status: The status of this Order. # noqa: E501
|
|
||||||
:type status: str
|
|
||||||
:param complete: The complete of this Order. # noqa: E501
|
|
||||||
:type complete: bool
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
'id': int,
|
|
||||||
'pet_id': int,
|
|
||||||
'quantity': int,
|
|
||||||
'ship_date': datetime,
|
|
||||||
'status': str,
|
|
||||||
'complete': bool
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
'id': 'id',
|
|
||||||
'pet_id': 'petId',
|
|
||||||
'quantity': 'quantity',
|
|
||||||
'ship_date': 'shipDate',
|
|
||||||
'status': 'status',
|
|
||||||
'complete': 'complete'
|
|
||||||
}
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
self._pet_id = pet_id
|
|
||||||
self._quantity = quantity
|
|
||||||
self._ship_date = ship_date
|
|
||||||
self._status = status
|
|
||||||
self._complete = complete
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'Order':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The Order of this Order. # noqa: E501
|
|
||||||
:rtype: Order
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def id(self):
|
|
||||||
"""Gets the id of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The id of this Order.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._id
|
|
||||||
|
|
||||||
@id.setter
|
|
||||||
def id(self, id):
|
|
||||||
"""Sets the id of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:param id: The id of this Order.
|
|
||||||
:type id: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
|
|
||||||
@property
|
|
||||||
def pet_id(self):
|
|
||||||
"""Gets the pet_id of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The pet_id of this Order.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._pet_id
|
|
||||||
|
|
||||||
@pet_id.setter
|
|
||||||
def pet_id(self, pet_id):
|
|
||||||
"""Sets the pet_id of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:param pet_id: The pet_id of this Order.
|
|
||||||
:type pet_id: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._pet_id = pet_id
|
|
||||||
|
|
||||||
@property
|
|
||||||
def quantity(self):
|
|
||||||
"""Gets the quantity of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The quantity of this Order.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._quantity
|
|
||||||
|
|
||||||
@quantity.setter
|
|
||||||
def quantity(self, quantity):
|
|
||||||
"""Sets the quantity of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:param quantity: The quantity of this Order.
|
|
||||||
:type quantity: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._quantity = quantity
|
|
||||||
|
|
||||||
@property
|
|
||||||
def ship_date(self):
|
|
||||||
"""Gets the ship_date of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The ship_date of this Order.
|
|
||||||
:rtype: datetime
|
|
||||||
"""
|
|
||||||
return self._ship_date
|
|
||||||
|
|
||||||
@ship_date.setter
|
|
||||||
def ship_date(self, ship_date):
|
|
||||||
"""Sets the ship_date of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:param ship_date: The ship_date of this Order.
|
|
||||||
:type ship_date: datetime
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._ship_date = ship_date
|
|
||||||
|
|
||||||
@property
|
|
||||||
def status(self):
|
|
||||||
"""Gets the status of this Order.
|
|
||||||
|
|
||||||
Order Status # noqa: E501
|
|
||||||
|
|
||||||
:return: The status of this Order.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._status
|
|
||||||
|
|
||||||
@status.setter
|
|
||||||
def status(self, status):
|
|
||||||
"""Sets the status of this Order.
|
|
||||||
|
|
||||||
Order Status # noqa: E501
|
|
||||||
|
|
||||||
:param status: The status of this Order.
|
|
||||||
:type status: str
|
|
||||||
"""
|
|
||||||
allowed_values = ["placed", "approved", "delivered"] # noqa: E501
|
|
||||||
if status not in allowed_values:
|
|
||||||
raise ValueError(
|
|
||||||
"Invalid value for `status` ({0}), must be one of {1}"
|
|
||||||
.format(status, allowed_values)
|
|
||||||
)
|
|
||||||
|
|
||||||
self._status = status
|
|
||||||
|
|
||||||
@property
|
|
||||||
def complete(self):
|
|
||||||
"""Gets the complete of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The complete of this Order.
|
|
||||||
:rtype: bool
|
|
||||||
"""
|
|
||||||
return self._complete
|
|
||||||
|
|
||||||
@complete.setter
|
|
||||||
def complete(self, complete):
|
|
||||||
"""Sets the complete of this Order.
|
|
||||||
|
|
||||||
|
|
||||||
:param complete: The complete of this Order.
|
|
||||||
:type complete: bool
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._complete = complete
|
|
||||||
@@ -1,210 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model import Model
|
|
||||||
from openapi_server.models.category import Category
|
|
||||||
from openapi_server.models.tag import Tag
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
from openapi_server.models.category import Category # noqa: E501
|
|
||||||
from openapi_server.models.tag import Tag # noqa: E501
|
|
||||||
|
|
||||||
class Pet(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501
|
|
||||||
"""Pet - a model defined in OpenAPI
|
|
||||||
|
|
||||||
:param id: The id of this Pet. # noqa: E501
|
|
||||||
:type id: int
|
|
||||||
:param category: The category of this Pet. # noqa: E501
|
|
||||||
:type category: Category
|
|
||||||
:param name: The name of this Pet. # noqa: E501
|
|
||||||
:type name: str
|
|
||||||
:param photo_urls: The photo_urls of this Pet. # noqa: E501
|
|
||||||
:type photo_urls: List[str]
|
|
||||||
:param tags: The tags of this Pet. # noqa: E501
|
|
||||||
:type tags: List[Tag]
|
|
||||||
:param status: The status of this Pet. # noqa: E501
|
|
||||||
:type status: str
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
'id': int,
|
|
||||||
'category': Category,
|
|
||||||
'name': str,
|
|
||||||
'photo_urls': List[str],
|
|
||||||
'tags': List[Tag],
|
|
||||||
'status': str
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
'id': 'id',
|
|
||||||
'category': 'category',
|
|
||||||
'name': 'name',
|
|
||||||
'photo_urls': 'photoUrls',
|
|
||||||
'tags': 'tags',
|
|
||||||
'status': 'status'
|
|
||||||
}
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
self._category = category
|
|
||||||
self._name = name
|
|
||||||
self._photo_urls = photo_urls
|
|
||||||
self._tags = tags
|
|
||||||
self._status = status
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'Pet':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The Pet of this Pet. # noqa: E501
|
|
||||||
:rtype: Pet
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def id(self):
|
|
||||||
"""Gets the id of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The id of this Pet.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._id
|
|
||||||
|
|
||||||
@id.setter
|
|
||||||
def id(self, id):
|
|
||||||
"""Sets the id of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:param id: The id of this Pet.
|
|
||||||
:type id: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
|
|
||||||
@property
|
|
||||||
def category(self):
|
|
||||||
"""Gets the category of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The category of this Pet.
|
|
||||||
:rtype: Category
|
|
||||||
"""
|
|
||||||
return self._category
|
|
||||||
|
|
||||||
@category.setter
|
|
||||||
def category(self, category):
|
|
||||||
"""Sets the category of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:param category: The category of this Pet.
|
|
||||||
:type category: Category
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._category = category
|
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Gets the name of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The name of this Pet.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._name
|
|
||||||
|
|
||||||
@name.setter
|
|
||||||
def name(self, name):
|
|
||||||
"""Sets the name of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:param name: The name of this Pet.
|
|
||||||
:type name: str
|
|
||||||
"""
|
|
||||||
if name is None:
|
|
||||||
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
|
||||||
|
|
||||||
self._name = name
|
|
||||||
|
|
||||||
@property
|
|
||||||
def photo_urls(self):
|
|
||||||
"""Gets the photo_urls of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The photo_urls of this Pet.
|
|
||||||
:rtype: List[str]
|
|
||||||
"""
|
|
||||||
return self._photo_urls
|
|
||||||
|
|
||||||
@photo_urls.setter
|
|
||||||
def photo_urls(self, photo_urls):
|
|
||||||
"""Sets the photo_urls of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:param photo_urls: The photo_urls of this Pet.
|
|
||||||
:type photo_urls: List[str]
|
|
||||||
"""
|
|
||||||
if photo_urls is None:
|
|
||||||
raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501
|
|
||||||
|
|
||||||
self._photo_urls = photo_urls
|
|
||||||
|
|
||||||
@property
|
|
||||||
def tags(self):
|
|
||||||
"""Gets the tags of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The tags of this Pet.
|
|
||||||
:rtype: List[Tag]
|
|
||||||
"""
|
|
||||||
return self._tags
|
|
||||||
|
|
||||||
@tags.setter
|
|
||||||
def tags(self, tags):
|
|
||||||
"""Sets the tags of this Pet.
|
|
||||||
|
|
||||||
|
|
||||||
:param tags: The tags of this Pet.
|
|
||||||
:type tags: List[Tag]
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._tags = tags
|
|
||||||
|
|
||||||
@property
|
|
||||||
def status(self):
|
|
||||||
"""Gets the status of this Pet.
|
|
||||||
|
|
||||||
pet status in the store # noqa: E501
|
|
||||||
|
|
||||||
:return: The status of this Pet.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._status
|
|
||||||
|
|
||||||
@status.setter
|
|
||||||
def status(self, status):
|
|
||||||
"""Sets the status of this Pet.
|
|
||||||
|
|
||||||
pet status in the store # noqa: E501
|
|
||||||
|
|
||||||
:param status: The status of this Pet.
|
|
||||||
:type status: str
|
|
||||||
"""
|
|
||||||
allowed_values = ["available", "pending", "sold"] # noqa: E501
|
|
||||||
if status not in allowed_values:
|
|
||||||
raise ValueError(
|
|
||||||
"Invalid value for `status` ({0}), must be one of {1}"
|
|
||||||
.format(status, allowed_values)
|
|
||||||
)
|
|
||||||
|
|
||||||
self._status = status
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model_ import Model
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
class PetForm(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, name=None, status=None): # noqa: E501
|
|
||||||
"""PetForm - a model defined in OpenAPI
|
|
||||||
|
|
||||||
:param name: The name of this PetForm. # noqa: E501
|
|
||||||
:type name: str
|
|
||||||
:param status: The status of this PetForm. # noqa: E501
|
|
||||||
:type status: str
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
'name': str,
|
|
||||||
'status': str
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
'name': 'name',
|
|
||||||
'status': 'status'
|
|
||||||
}
|
|
||||||
|
|
||||||
self._name = name
|
|
||||||
self._status = status
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'PetForm':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The PetForm of this PetForm. # noqa: E501
|
|
||||||
:rtype: PetForm
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Gets the name of this PetForm.
|
|
||||||
|
|
||||||
Updated name of the pet # noqa: E501
|
|
||||||
|
|
||||||
:return: The name of this PetForm.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._name
|
|
||||||
|
|
||||||
@name.setter
|
|
||||||
def name(self, name):
|
|
||||||
"""Sets the name of this PetForm.
|
|
||||||
|
|
||||||
Updated name of the pet # noqa: E501
|
|
||||||
|
|
||||||
:param name: The name of this PetForm.
|
|
||||||
:type name: str
|
|
||||||
"""
|
|
||||||
if name is None:
|
|
||||||
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
|
||||||
|
|
||||||
self._name = name
|
|
||||||
|
|
||||||
@property
|
|
||||||
def status(self):
|
|
||||||
"""Gets the status of this PetForm.
|
|
||||||
|
|
||||||
Updated status of the pet # noqa: E501
|
|
||||||
|
|
||||||
:return: The status of this PetForm.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._status
|
|
||||||
|
|
||||||
@status.setter
|
|
||||||
def status(self, status):
|
|
||||||
"""Sets the status of this PetForm.
|
|
||||||
|
|
||||||
Updated status of the pet # noqa: E501
|
|
||||||
|
|
||||||
:param status: The status of this PetForm.
|
|
||||||
:type status: str
|
|
||||||
"""
|
|
||||||
if status is None:
|
|
||||||
raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501
|
|
||||||
|
|
||||||
self._status = status
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model import Model
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
class StatusEnum(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
"""
|
|
||||||
allowed enum values
|
|
||||||
"""
|
|
||||||
AVAILABLE = "available"
|
|
||||||
PENDING = "pending"
|
|
||||||
SOLD = "sold"
|
|
||||||
def __init__(self): # noqa: E501
|
|
||||||
"""StatusEnum - a model defined in OpenAPI
|
|
||||||
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
}
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'StatusEnum':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The statusEnum of this StatusEnum. # noqa: E501
|
|
||||||
:rtype: StatusEnum
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model import Model
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
class Tag(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, id=None, name=None): # noqa: E501
|
|
||||||
"""Tag - a model defined in OpenAPI
|
|
||||||
|
|
||||||
:param id: The id of this Tag. # noqa: E501
|
|
||||||
:type id: int
|
|
||||||
:param name: The name of this Tag. # noqa: E501
|
|
||||||
:type name: str
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
'id': int,
|
|
||||||
'name': str
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
'id': 'id',
|
|
||||||
'name': 'name'
|
|
||||||
}
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
self._name = name
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'Tag':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The Tag of this Tag. # noqa: E501
|
|
||||||
:rtype: Tag
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def id(self):
|
|
||||||
"""Gets the id of this Tag.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The id of this Tag.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._id
|
|
||||||
|
|
||||||
@id.setter
|
|
||||||
def id(self, id):
|
|
||||||
"""Sets the id of this Tag.
|
|
||||||
|
|
||||||
|
|
||||||
:param id: The id of this Tag.
|
|
||||||
:type id: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Gets the name of this Tag.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The name of this Tag.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._name
|
|
||||||
|
|
||||||
@name.setter
|
|
||||||
def name(self, name):
|
|
||||||
"""Sets the name of this Tag.
|
|
||||||
|
|
||||||
|
|
||||||
:param name: The name of this Tag.
|
|
||||||
:type name: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._name = name
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model_ import Model
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
class UploadForm(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, additional_metadata=None, file=None): # noqa: E501
|
|
||||||
"""UploadForm - a model defined in OpenAPI
|
|
||||||
|
|
||||||
:param additional_metadata: The additional_metadata of this UploadForm. # noqa: E501
|
|
||||||
:type additional_metadata: str
|
|
||||||
:param file: The file of this UploadForm. # noqa: E501
|
|
||||||
:type file: file
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
'additional_metadata': str,
|
|
||||||
'file': file
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
'additional_metadata': 'additionalMetadata',
|
|
||||||
'file': 'file'
|
|
||||||
}
|
|
||||||
|
|
||||||
self._additional_metadata = additional_metadata
|
|
||||||
self._file = file
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'UploadForm':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The UploadForm of this UploadForm. # noqa: E501
|
|
||||||
:rtype: UploadForm
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def additional_metadata(self):
|
|
||||||
"""Gets the additional_metadata of this UploadForm.
|
|
||||||
|
|
||||||
Additional data to pass to server # noqa: E501
|
|
||||||
|
|
||||||
:return: The additional_metadata of this UploadForm.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._additional_metadata
|
|
||||||
|
|
||||||
@additional_metadata.setter
|
|
||||||
def additional_metadata(self, additional_metadata):
|
|
||||||
"""Sets the additional_metadata of this UploadForm.
|
|
||||||
|
|
||||||
Additional data to pass to server # noqa: E501
|
|
||||||
|
|
||||||
:param additional_metadata: The additional_metadata of this UploadForm.
|
|
||||||
:type additional_metadata: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._additional_metadata = additional_metadata
|
|
||||||
|
|
||||||
@property
|
|
||||||
def file(self):
|
|
||||||
"""Gets the file of this UploadForm.
|
|
||||||
|
|
||||||
file to upload # noqa: E501
|
|
||||||
|
|
||||||
:return: The file of this UploadForm.
|
|
||||||
:rtype: file
|
|
||||||
"""
|
|
||||||
return self._file
|
|
||||||
|
|
||||||
@file.setter
|
|
||||||
def file(self, file):
|
|
||||||
"""Sets the file of this UploadForm.
|
|
||||||
|
|
||||||
file to upload # noqa: E501
|
|
||||||
|
|
||||||
:param file: The file of this UploadForm.
|
|
||||||
:type file: file
|
|
||||||
"""
|
|
||||||
if file is None:
|
|
||||||
raise ValueError("Invalid value for `file`, must not be `None`") # noqa: E501
|
|
||||||
|
|
||||||
self._file = file
|
|
||||||
@@ -1,248 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from datetime import date, datetime # noqa: F401
|
|
||||||
|
|
||||||
from typing import List, Dict # noqa: F401
|
|
||||||
|
|
||||||
from openapi_server.models.base_model import Model
|
|
||||||
from openapi_server import util
|
|
||||||
|
|
||||||
|
|
||||||
class User(Model):
|
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
|
|
||||||
Do not edit the class manually.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501
|
|
||||||
"""User - a model defined in OpenAPI
|
|
||||||
|
|
||||||
:param id: The id of this User. # noqa: E501
|
|
||||||
:type id: int
|
|
||||||
:param username: The username of this User. # noqa: E501
|
|
||||||
:type username: str
|
|
||||||
:param first_name: The first_name of this User. # noqa: E501
|
|
||||||
:type first_name: str
|
|
||||||
:param last_name: The last_name of this User. # noqa: E501
|
|
||||||
:type last_name: str
|
|
||||||
:param email: The email of this User. # noqa: E501
|
|
||||||
:type email: str
|
|
||||||
:param password: The password of this User. # noqa: E501
|
|
||||||
:type password: str
|
|
||||||
:param phone: The phone of this User. # noqa: E501
|
|
||||||
:type phone: str
|
|
||||||
:param user_status: The user_status of this User. # noqa: E501
|
|
||||||
:type user_status: int
|
|
||||||
"""
|
|
||||||
self.openapi_types = {
|
|
||||||
'id': int,
|
|
||||||
'username': str,
|
|
||||||
'first_name': str,
|
|
||||||
'last_name': str,
|
|
||||||
'email': str,
|
|
||||||
'password': str,
|
|
||||||
'phone': str,
|
|
||||||
'user_status': int
|
|
||||||
}
|
|
||||||
|
|
||||||
self.attribute_map = {
|
|
||||||
'id': 'id',
|
|
||||||
'username': 'username',
|
|
||||||
'first_name': 'firstName',
|
|
||||||
'last_name': 'lastName',
|
|
||||||
'email': 'email',
|
|
||||||
'password': 'password',
|
|
||||||
'phone': 'phone',
|
|
||||||
'user_status': 'userStatus'
|
|
||||||
}
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
self._username = username
|
|
||||||
self._first_name = first_name
|
|
||||||
self._last_name = last_name
|
|
||||||
self._email = email
|
|
||||||
self._password = password
|
|
||||||
self._phone = phone
|
|
||||||
self._user_status = user_status
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls, dikt) -> 'User':
|
|
||||||
"""Returns the dict as a model
|
|
||||||
|
|
||||||
:param dikt: A dict.
|
|
||||||
:type: dict
|
|
||||||
:return: The User of this User. # noqa: E501
|
|
||||||
:rtype: User
|
|
||||||
"""
|
|
||||||
return util.deserialize_model(dikt, cls)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def id(self):
|
|
||||||
"""Gets the id of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The id of this User.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._id
|
|
||||||
|
|
||||||
@id.setter
|
|
||||||
def id(self, id):
|
|
||||||
"""Sets the id of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:param id: The id of this User.
|
|
||||||
:type id: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._id = id
|
|
||||||
|
|
||||||
@property
|
|
||||||
def username(self):
|
|
||||||
"""Gets the username of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The username of this User.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._username
|
|
||||||
|
|
||||||
@username.setter
|
|
||||||
def username(self, username):
|
|
||||||
"""Sets the username of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:param username: The username of this User.
|
|
||||||
:type username: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._username = username
|
|
||||||
|
|
||||||
@property
|
|
||||||
def first_name(self):
|
|
||||||
"""Gets the first_name of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The first_name of this User.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._first_name
|
|
||||||
|
|
||||||
@first_name.setter
|
|
||||||
def first_name(self, first_name):
|
|
||||||
"""Sets the first_name of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:param first_name: The first_name of this User.
|
|
||||||
:type first_name: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._first_name = first_name
|
|
||||||
|
|
||||||
@property
|
|
||||||
def last_name(self):
|
|
||||||
"""Gets the last_name of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The last_name of this User.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._last_name
|
|
||||||
|
|
||||||
@last_name.setter
|
|
||||||
def last_name(self, last_name):
|
|
||||||
"""Sets the last_name of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:param last_name: The last_name of this User.
|
|
||||||
:type last_name: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._last_name = last_name
|
|
||||||
|
|
||||||
@property
|
|
||||||
def email(self):
|
|
||||||
"""Gets the email of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The email of this User.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._email
|
|
||||||
|
|
||||||
@email.setter
|
|
||||||
def email(self, email):
|
|
||||||
"""Sets the email of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:param email: The email of this User.
|
|
||||||
:type email: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._email = email
|
|
||||||
|
|
||||||
@property
|
|
||||||
def password(self):
|
|
||||||
"""Gets the password of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The password of this User.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._password
|
|
||||||
|
|
||||||
@password.setter
|
|
||||||
def password(self, password):
|
|
||||||
"""Sets the password of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:param password: The password of this User.
|
|
||||||
:type password: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._password = password
|
|
||||||
|
|
||||||
@property
|
|
||||||
def phone(self):
|
|
||||||
"""Gets the phone of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:return: The phone of this User.
|
|
||||||
:rtype: str
|
|
||||||
"""
|
|
||||||
return self._phone
|
|
||||||
|
|
||||||
@phone.setter
|
|
||||||
def phone(self, phone):
|
|
||||||
"""Sets the phone of this User.
|
|
||||||
|
|
||||||
|
|
||||||
:param phone: The phone of this User.
|
|
||||||
:type phone: str
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._phone = phone
|
|
||||||
|
|
||||||
@property
|
|
||||||
def user_status(self):
|
|
||||||
"""Gets the user_status of this User.
|
|
||||||
|
|
||||||
User Status # noqa: E501
|
|
||||||
|
|
||||||
:return: The user_status of this User.
|
|
||||||
:rtype: int
|
|
||||||
"""
|
|
||||||
return self._user_status
|
|
||||||
|
|
||||||
@user_status.setter
|
|
||||||
def user_status(self, user_status):
|
|
||||||
"""Sets the user_status of this User.
|
|
||||||
|
|
||||||
User Status # noqa: E501
|
|
||||||
|
|
||||||
:param user_status: The user_status of this User.
|
|
||||||
:type user_status: int
|
|
||||||
"""
|
|
||||||
|
|
||||||
self._user_status = user_status
|
|
||||||
@@ -1,924 +0,0 @@
|
|||||||
openapi: 3.0.1
|
|
||||||
info:
|
|
||||||
description: "This is a sample server Petstore server. For this sample, you can\
|
|
||||||
\ use the api key `special-key` to test the authorization filters."
|
|
||||||
license:
|
|
||||||
name: Apache-2.0
|
|
||||||
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
title: OpenAPI Petstore
|
|
||||||
version: 1.0.0
|
|
||||||
externalDocs:
|
|
||||||
description: Find out more about Swagger
|
|
||||||
url: http://swagger.io
|
|
||||||
servers:
|
|
||||||
- url: http://petstore.swagger.io/v2
|
|
||||||
tags:
|
|
||||||
- description: Everything about your Pets
|
|
||||||
name: pet
|
|
||||||
- description: Access to Petstore orders
|
|
||||||
name: store
|
|
||||||
- description: Operations about user
|
|
||||||
name: user
|
|
||||||
paths:
|
|
||||||
/pet:
|
|
||||||
post:
|
|
||||||
description: ""
|
|
||||||
operationId: add_pet
|
|
||||||
requestBody:
|
|
||||||
$ref: '#/components/requestBodies/Pet'
|
|
||||||
responses:
|
|
||||||
"405":
|
|
||||||
description: Invalid input
|
|
||||||
security:
|
|
||||||
- petstore_auth:
|
|
||||||
- write:pets
|
|
||||||
- read:pets
|
|
||||||
summary: Add a new pet to the store
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
put:
|
|
||||||
description: ""
|
|
||||||
operationId: update_pet
|
|
||||||
requestBody:
|
|
||||||
$ref: '#/components/requestBodies/Pet'
|
|
||||||
responses:
|
|
||||||
"400":
|
|
||||||
description: Invalid ID supplied
|
|
||||||
"404":
|
|
||||||
description: Pet not found
|
|
||||||
"405":
|
|
||||||
description: Validation exception
|
|
||||||
security:
|
|
||||||
- petstore_auth:
|
|
||||||
- write:pets
|
|
||||||
- read:pets
|
|
||||||
summary: Update an existing pet
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
/pet/findByStatus:
|
|
||||||
get:
|
|
||||||
description: Multiple status values can be provided with comma separated strings
|
|
||||||
operationId: find_pets_by_status
|
|
||||||
parameters:
|
|
||||||
- description: Status values that need to be considered for filter
|
|
||||||
explode: false
|
|
||||||
in: query
|
|
||||||
name: status
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
default: available
|
|
||||||
enum:
|
|
||||||
- available
|
|
||||||
- pending
|
|
||||||
- sold
|
|
||||||
type: string
|
|
||||||
type: array
|
|
||||||
style: form
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
type: array
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
type: array
|
|
||||||
description: successful operation
|
|
||||||
"400":
|
|
||||||
description: Invalid status value
|
|
||||||
security:
|
|
||||||
- petstore_auth:
|
|
||||||
- read:pets
|
|
||||||
summary: Finds Pets by status
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
/pet/findByTags:
|
|
||||||
get:
|
|
||||||
deprecated: true
|
|
||||||
description: "Multiple tags can be provided with comma separated strings. Use\
|
|
||||||
\ tag1, tag2, tag3 for testing."
|
|
||||||
operationId: find_pets_by_tags
|
|
||||||
parameters:
|
|
||||||
- description: Tags to filter by
|
|
||||||
explode: false
|
|
||||||
in: query
|
|
||||||
name: tags
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
type: array
|
|
||||||
style: form
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
type: array
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
type: array
|
|
||||||
description: successful operation
|
|
||||||
"400":
|
|
||||||
description: Invalid tag value
|
|
||||||
security:
|
|
||||||
- petstore_auth:
|
|
||||||
- read:pets
|
|
||||||
summary: Finds Pets by tags
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
/pet/{petId}:
|
|
||||||
delete:
|
|
||||||
description: ""
|
|
||||||
operationId: delete_pet
|
|
||||||
parameters:
|
|
||||||
- explode: false
|
|
||||||
in: header
|
|
||||||
name: api_key
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: simple
|
|
||||||
- description: Pet id to delete
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: petId
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
format: int64
|
|
||||||
type: integer
|
|
||||||
style: simple
|
|
||||||
responses:
|
|
||||||
"400":
|
|
||||||
description: Invalid pet value
|
|
||||||
security:
|
|
||||||
- petstore_auth:
|
|
||||||
- write:pets
|
|
||||||
- read:pets
|
|
||||||
summary: Deletes a pet
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
get:
|
|
||||||
description: Returns a single pet
|
|
||||||
operationId: get_pet_by_id
|
|
||||||
parameters:
|
|
||||||
- description: ID of pet to return
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: petId
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
format: int64
|
|
||||||
type: integer
|
|
||||||
style: simple
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
description: successful operation
|
|
||||||
"400":
|
|
||||||
description: Invalid ID supplied
|
|
||||||
"404":
|
|
||||||
description: Pet not found
|
|
||||||
security:
|
|
||||||
- api_key: []
|
|
||||||
summary: Find pet by ID
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
patch:
|
|
||||||
description: ""
|
|
||||||
operationId: update_pet_status_with_enum
|
|
||||||
parameters:
|
|
||||||
- description: ID of pet to return
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: petId
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
format: int64
|
|
||||||
type: integer
|
|
||||||
style: simple
|
|
||||||
- description: The required status
|
|
||||||
example: pending
|
|
||||||
explode: true
|
|
||||||
in: query
|
|
||||||
name: status
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/statusEnum'
|
|
||||||
style: form
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
description: successful operation
|
|
||||||
"400":
|
|
||||||
description: Invalid ID supplied
|
|
||||||
"404":
|
|
||||||
description: Pet not found
|
|
||||||
summary: Set the status of a pet in the store using an enum
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
post:
|
|
||||||
description: ""
|
|
||||||
operationId: update_pet_with_form
|
|
||||||
parameters:
|
|
||||||
- description: ID of pet that needs to be updated
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: petId
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
format: int64
|
|
||||||
type: integer
|
|
||||||
style: simple
|
|
||||||
requestBody:
|
|
||||||
$ref: '#/components/requestBodies/PetForm'
|
|
||||||
responses:
|
|
||||||
"405":
|
|
||||||
description: Invalid input
|
|
||||||
security:
|
|
||||||
- petstore_auth:
|
|
||||||
- write:pets
|
|
||||||
- read:pets
|
|
||||||
summary: Updates a pet in the store with form data
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
/pet/{petId}/uploadImage:
|
|
||||||
post:
|
|
||||||
description: ""
|
|
||||||
operationId: upload_file
|
|
||||||
parameters:
|
|
||||||
- description: ID of pet to update
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: petId
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
format: int64
|
|
||||||
type: integer
|
|
||||||
style: simple
|
|
||||||
requestBody:
|
|
||||||
$ref: '#/components/requestBodies/UploadForm'
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/ApiResponse'
|
|
||||||
description: successful operation
|
|
||||||
security:
|
|
||||||
- petstore_auth:
|
|
||||||
- write:pets
|
|
||||||
- read:pets
|
|
||||||
summary: uploads an image
|
|
||||||
tags:
|
|
||||||
- pet
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.pet_controller
|
|
||||||
/store/inventory:
|
|
||||||
get:
|
|
||||||
description: Returns a map of status codes to quantities
|
|
||||||
operationId: get_inventory
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
additionalProperties:
|
|
||||||
format: int32
|
|
||||||
type: integer
|
|
||||||
type: object
|
|
||||||
description: successful operation
|
|
||||||
security:
|
|
||||||
- api_key: []
|
|
||||||
summary: Returns pet inventories by status
|
|
||||||
tags:
|
|
||||||
- store
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.store_controller
|
|
||||||
/store/order:
|
|
||||||
post:
|
|
||||||
description: ""
|
|
||||||
operationId: place_order
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Order'
|
|
||||||
description: order placed for purchasing the pet
|
|
||||||
required: true
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Order'
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Order'
|
|
||||||
description: successful operation
|
|
||||||
"400":
|
|
||||||
description: Invalid Order
|
|
||||||
summary: Place an order for a pet
|
|
||||||
tags:
|
|
||||||
- store
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.store_controller
|
|
||||||
/store/order/{orderId}:
|
|
||||||
delete:
|
|
||||||
description: For valid response try integer IDs with value < 1000. Anything
|
|
||||||
above 1000 or nonintegers will generate API errors
|
|
||||||
operationId: delete_order
|
|
||||||
parameters:
|
|
||||||
- description: ID of the order that needs to be deleted
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: orderId
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: simple
|
|
||||||
responses:
|
|
||||||
"400":
|
|
||||||
description: Invalid ID supplied
|
|
||||||
"404":
|
|
||||||
description: Order not found
|
|
||||||
summary: Delete purchase order by ID
|
|
||||||
tags:
|
|
||||||
- store
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.store_controller
|
|
||||||
get:
|
|
||||||
description: For valid response try integer IDs with value <= 5 or > 10. Other
|
|
||||||
values will generate exceptions
|
|
||||||
operationId: get_order_by_id
|
|
||||||
parameters:
|
|
||||||
- description: ID of pet that needs to be fetched
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: orderId
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
format: int64
|
|
||||||
maximum: 5
|
|
||||||
minimum: 1
|
|
||||||
type: integer
|
|
||||||
style: simple
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Order'
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Order'
|
|
||||||
description: successful operation
|
|
||||||
"400":
|
|
||||||
description: Invalid ID supplied
|
|
||||||
"404":
|
|
||||||
description: Order not found
|
|
||||||
summary: Find purchase order by ID
|
|
||||||
tags:
|
|
||||||
- store
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.store_controller
|
|
||||||
/user:
|
|
||||||
post:
|
|
||||||
description: This can only be done by the logged in user.
|
|
||||||
operationId: create_user
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/User'
|
|
||||||
description: Created user object
|
|
||||||
required: true
|
|
||||||
responses:
|
|
||||||
default:
|
|
||||||
description: successful operation
|
|
||||||
security:
|
|
||||||
- auth_cookie: []
|
|
||||||
summary: Create user
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.user_controller
|
|
||||||
/user/createWithArray:
|
|
||||||
post:
|
|
||||||
description: ""
|
|
||||||
operationId: create_users_with_array_input
|
|
||||||
requestBody:
|
|
||||||
$ref: '#/components/requestBodies/UserArray'
|
|
||||||
responses:
|
|
||||||
default:
|
|
||||||
description: successful operation
|
|
||||||
security:
|
|
||||||
- auth_cookie: []
|
|
||||||
summary: Creates list of users with given input array
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.user_controller
|
|
||||||
/user/createWithList:
|
|
||||||
post:
|
|
||||||
description: ""
|
|
||||||
operationId: create_users_with_list_input
|
|
||||||
requestBody:
|
|
||||||
$ref: '#/components/requestBodies/UserArray'
|
|
||||||
responses:
|
|
||||||
default:
|
|
||||||
description: successful operation
|
|
||||||
security:
|
|
||||||
- auth_cookie: []
|
|
||||||
summary: Creates list of users with given input array
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.user_controller
|
|
||||||
/user/login:
|
|
||||||
get:
|
|
||||||
description: ""
|
|
||||||
operationId: login_user
|
|
||||||
parameters:
|
|
||||||
- description: The user name for login
|
|
||||||
explode: true
|
|
||||||
in: query
|
|
||||||
name: username
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
- description: The password for login in clear text
|
|
||||||
explode: true
|
|
||||||
in: query
|
|
||||||
name: password
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: form
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
description: successful operation
|
|
||||||
headers:
|
|
||||||
Set-Cookie:
|
|
||||||
description: Cookie authentication key for use with the `auth_cookie`
|
|
||||||
apiKey authentication.
|
|
||||||
explode: false
|
|
||||||
schema:
|
|
||||||
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
|
|
||||||
type: string
|
|
||||||
style: simple
|
|
||||||
X-Rate-Limit:
|
|
||||||
description: calls per hour allowed by the user
|
|
||||||
explode: false
|
|
||||||
schema:
|
|
||||||
format: int32
|
|
||||||
type: integer
|
|
||||||
style: simple
|
|
||||||
X-Expires-After:
|
|
||||||
description: date in UTC when token expires
|
|
||||||
explode: false
|
|
||||||
schema:
|
|
||||||
format: date-time
|
|
||||||
type: string
|
|
||||||
style: simple
|
|
||||||
"400":
|
|
||||||
description: Invalid username/password supplied
|
|
||||||
summary: Logs user into the system
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.user_controller
|
|
||||||
/user/logout:
|
|
||||||
get:
|
|
||||||
description: ""
|
|
||||||
operationId: logout_user
|
|
||||||
responses:
|
|
||||||
default:
|
|
||||||
description: successful operation
|
|
||||||
security:
|
|
||||||
- auth_cookie: []
|
|
||||||
summary: Logs out current logged in user session
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.user_controller
|
|
||||||
/user/{username}:
|
|
||||||
delete:
|
|
||||||
description: This can only be done by the logged in user.
|
|
||||||
operationId: delete_user
|
|
||||||
parameters:
|
|
||||||
- description: The name that needs to be deleted
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: username
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: simple
|
|
||||||
responses:
|
|
||||||
"400":
|
|
||||||
description: Invalid username supplied
|
|
||||||
"404":
|
|
||||||
description: User not found
|
|
||||||
security:
|
|
||||||
- auth_cookie: []
|
|
||||||
summary: Delete user
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.user_controller
|
|
||||||
get:
|
|
||||||
description: ""
|
|
||||||
operationId: get_user_by_name
|
|
||||||
parameters:
|
|
||||||
- description: The name that needs to be fetched. Use user1 for testing.
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: username
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: simple
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
content:
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/User'
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/User'
|
|
||||||
description: successful operation
|
|
||||||
"400":
|
|
||||||
description: Invalid username supplied
|
|
||||||
"404":
|
|
||||||
description: User not found
|
|
||||||
summary: Get user by user name
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.user_controller
|
|
||||||
put:
|
|
||||||
description: This can only be done by the logged in user.
|
|
||||||
operationId: update_user
|
|
||||||
parameters:
|
|
||||||
- description: name that need to be deleted
|
|
||||||
explode: false
|
|
||||||
in: path
|
|
||||||
name: username
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
style: simple
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/User'
|
|
||||||
description: Updated user object
|
|
||||||
required: true
|
|
||||||
responses:
|
|
||||||
"400":
|
|
||||||
description: Invalid user supplied
|
|
||||||
"404":
|
|
||||||
description: User not found
|
|
||||||
security:
|
|
||||||
- auth_cookie: []
|
|
||||||
summary: Updated user
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
x-openapi-router-controller: openapi_server.controllers.user_controller
|
|
||||||
components:
|
|
||||||
parameters:
|
|
||||||
statusEnum:
|
|
||||||
description: The required status
|
|
||||||
example: pending
|
|
||||||
explode: true
|
|
||||||
in: query
|
|
||||||
name: status
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/statusEnum'
|
|
||||||
style: form
|
|
||||||
requestBodies:
|
|
||||||
UserArray:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/User'
|
|
||||||
type: array
|
|
||||||
description: List of user objects
|
|
||||||
required: true
|
|
||||||
Pet:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
application/xml:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Pet'
|
|
||||||
description: Pet object that needs to be added to the store
|
|
||||||
required: true
|
|
||||||
PetForm:
|
|
||||||
content:
|
|
||||||
application/x-www-form-urlencoded:
|
|
||||||
example:
|
|
||||||
name: fluffy
|
|
||||||
status: available
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/PetForm'
|
|
||||||
UploadForm:
|
|
||||||
content:
|
|
||||||
multipart/form-data:
|
|
||||||
example:
|
|
||||||
additionalMetadata: additional metadata example
|
|
||||||
file: c29tZSB0ZXN0IGRhdGEK
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/UploadForm'
|
|
||||||
schemas:
|
|
||||||
Order:
|
|
||||||
description: An order for a pets from the pet store
|
|
||||||
example:
|
|
||||||
petId: 6
|
|
||||||
quantity: 1
|
|
||||||
id: 0
|
|
||||||
shipDate: 2000-01-23T04:56:07.000+00:00
|
|
||||||
complete: false
|
|
||||||
status: placed
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
format: int64
|
|
||||||
title: id
|
|
||||||
type: integer
|
|
||||||
petId:
|
|
||||||
format: int64
|
|
||||||
title: petId
|
|
||||||
type: integer
|
|
||||||
quantity:
|
|
||||||
format: int32
|
|
||||||
title: quantity
|
|
||||||
type: integer
|
|
||||||
shipDate:
|
|
||||||
format: date-time
|
|
||||||
title: shipDate
|
|
||||||
type: string
|
|
||||||
status:
|
|
||||||
description: Order Status
|
|
||||||
enum:
|
|
||||||
- placed
|
|
||||||
- approved
|
|
||||||
- delivered
|
|
||||||
title: status
|
|
||||||
type: string
|
|
||||||
complete:
|
|
||||||
default: false
|
|
||||||
title: complete
|
|
||||||
type: boolean
|
|
||||||
title: Pet Order
|
|
||||||
type: object
|
|
||||||
xml:
|
|
||||||
name: Order
|
|
||||||
Category:
|
|
||||||
description: A category for a pet
|
|
||||||
example:
|
|
||||||
name: name
|
|
||||||
id: 6
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
format: int64
|
|
||||||
title: id
|
|
||||||
type: integer
|
|
||||||
name:
|
|
||||||
pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
|
|
||||||
title: name
|
|
||||||
type: string
|
|
||||||
title: Pet category
|
|
||||||
type: object
|
|
||||||
xml:
|
|
||||||
name: Category
|
|
||||||
User:
|
|
||||||
description: A User who is purchasing from the pet store
|
|
||||||
example:
|
|
||||||
firstName: firstName
|
|
||||||
lastName: lastName
|
|
||||||
password: password
|
|
||||||
userStatus: 6
|
|
||||||
phone: phone
|
|
||||||
id: 0
|
|
||||||
email: email
|
|
||||||
username: username
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
format: int64
|
|
||||||
title: id
|
|
||||||
type: integer
|
|
||||||
username:
|
|
||||||
title: username
|
|
||||||
type: string
|
|
||||||
firstName:
|
|
||||||
title: firstName
|
|
||||||
type: string
|
|
||||||
lastName:
|
|
||||||
title: lastName
|
|
||||||
type: string
|
|
||||||
email:
|
|
||||||
title: email
|
|
||||||
type: string
|
|
||||||
password:
|
|
||||||
title: password
|
|
||||||
type: string
|
|
||||||
phone:
|
|
||||||
title: phone
|
|
||||||
type: string
|
|
||||||
userStatus:
|
|
||||||
description: User Status
|
|
||||||
format: int32
|
|
||||||
title: userStatus
|
|
||||||
type: integer
|
|
||||||
title: a User
|
|
||||||
type: object
|
|
||||||
xml:
|
|
||||||
name: User
|
|
||||||
Tag:
|
|
||||||
description: A tag for a pet
|
|
||||||
example:
|
|
||||||
name: name
|
|
||||||
id: 1
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
format: int64
|
|
||||||
title: id
|
|
||||||
type: integer
|
|
||||||
name:
|
|
||||||
title: name
|
|
||||||
type: string
|
|
||||||
title: Pet Tag
|
|
||||||
type: object
|
|
||||||
xml:
|
|
||||||
name: Tag
|
|
||||||
Pet:
|
|
||||||
description: A pet for sale in the pet store
|
|
||||||
example:
|
|
||||||
photoUrls:
|
|
||||||
- photoUrls
|
|
||||||
- photoUrls
|
|
||||||
name: doggie
|
|
||||||
id: 0
|
|
||||||
category:
|
|
||||||
name: name
|
|
||||||
id: 6
|
|
||||||
tags:
|
|
||||||
- name: name
|
|
||||||
id: 1
|
|
||||||
- name: name
|
|
||||||
id: 1
|
|
||||||
status: available
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
format: int64
|
|
||||||
title: id
|
|
||||||
type: integer
|
|
||||||
category:
|
|
||||||
$ref: '#/components/schemas/Category'
|
|
||||||
name:
|
|
||||||
example: doggie
|
|
||||||
title: name
|
|
||||||
type: string
|
|
||||||
photoUrls:
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
title: photoUrls
|
|
||||||
type: array
|
|
||||||
xml:
|
|
||||||
name: photoUrl
|
|
||||||
wrapped: true
|
|
||||||
tags:
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/Tag'
|
|
||||||
title: tags
|
|
||||||
type: array
|
|
||||||
xml:
|
|
||||||
name: tag
|
|
||||||
wrapped: true
|
|
||||||
status:
|
|
||||||
description: pet status in the store
|
|
||||||
enum:
|
|
||||||
- available
|
|
||||||
- pending
|
|
||||||
- sold
|
|
||||||
title: status
|
|
||||||
type: string
|
|
||||||
required:
|
|
||||||
- name
|
|
||||||
- photoUrls
|
|
||||||
title: a Pet
|
|
||||||
type: object
|
|
||||||
xml:
|
|
||||||
name: Pet
|
|
||||||
PetForm:
|
|
||||||
description: A form for updating a pet
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
description: Updated name of the pet
|
|
||||||
title: name
|
|
||||||
type: string
|
|
||||||
status:
|
|
||||||
description: Updated status of the pet
|
|
||||||
title: status
|
|
||||||
type: string
|
|
||||||
required:
|
|
||||||
- name
|
|
||||||
- status
|
|
||||||
title: A pet form
|
|
||||||
type: object
|
|
||||||
UploadForm:
|
|
||||||
description: A form for attaching files to a pet
|
|
||||||
properties:
|
|
||||||
additionalMetadata:
|
|
||||||
description: Additional data to pass to server
|
|
||||||
title: additionalMetadata
|
|
||||||
type: string
|
|
||||||
file:
|
|
||||||
description: file to upload
|
|
||||||
format: binary
|
|
||||||
title: file
|
|
||||||
type: string
|
|
||||||
required:
|
|
||||||
- file
|
|
||||||
title: An upload form
|
|
||||||
type: object
|
|
||||||
ApiResponse:
|
|
||||||
description: Describes the result of uploading an image resource
|
|
||||||
example:
|
|
||||||
code: 0
|
|
||||||
type: type
|
|
||||||
message: message
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
format: int32
|
|
||||||
title: code
|
|
||||||
type: integer
|
|
||||||
type:
|
|
||||||
title: type
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
title: message
|
|
||||||
type: string
|
|
||||||
title: An uploaded response
|
|
||||||
type: object
|
|
||||||
statusEnum:
|
|
||||||
description: pet status in the store
|
|
||||||
enum:
|
|
||||||
- available
|
|
||||||
- pending
|
|
||||||
- sold
|
|
||||||
title: statusEnum
|
|
||||||
type: string
|
|
||||||
securitySchemes:
|
|
||||||
petstore_auth:
|
|
||||||
flows:
|
|
||||||
implicit:
|
|
||||||
authorizationUrl: http://petstore.swagger.io/api/oauth/dialog
|
|
||||||
scopes:
|
|
||||||
write:pets: modify pets in your account
|
|
||||||
read:pets: read your pets
|
|
||||||
type: oauth2
|
|
||||||
x-tokenInfoFunc: openapi_server.controllers.security_controller.info_from_petstore_auth
|
|
||||||
x-scopeValidateFunc: openapi_server.controllers.security_controller.validate_scope_petstore_auth
|
|
||||||
api_key:
|
|
||||||
in: header
|
|
||||||
name: api_key
|
|
||||||
type: apiKey
|
|
||||||
x-apikeyInfoFunc: openapi_server.controllers.security_controller.info_from_api_key
|
|
||||||
auth_cookie:
|
|
||||||
in: cookie
|
|
||||||
name: AUTH_KEY
|
|
||||||
type: apiKey
|
|
||||||
x-apikeyInfoFunc: openapi_server.controllers.security_controller.info_from_auth_cookie
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import logging
|
|
||||||
|
|
||||||
import connexion
|
|
||||||
from flask_testing import TestCase
|
|
||||||
|
|
||||||
from openapi_server.encoder import JSONEncoder
|
|
||||||
|
|
||||||
|
|
||||||
class BaseTestCase(TestCase):
|
|
||||||
|
|
||||||
def create_app(self):
|
|
||||||
logging.getLogger('connexion.operation').setLevel('ERROR')
|
|
||||||
app = connexion.App(__name__, specification_dir='../openapi/')
|
|
||||||
app.app.json_encoder = JSONEncoder
|
|
||||||
app.add_api('openapi.yaml', pythonic_params=True)
|
|
||||||
return app.app
|
|
||||||
@@ -1,220 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from flask import json
|
|
||||||
from io import BytesIO
|
|
||||||
|
|
||||||
from openapi_server.models.api_response import ApiResponse # noqa: E501
|
|
||||||
from openapi_server.models.pet import Pet # noqa: E501
|
|
||||||
from openapi_server.models.pet_form import PetForm # noqa: E501
|
|
||||||
from openapi_server.models.status_enum import StatusEnum # noqa: E501
|
|
||||||
from openapi_server.models.upload_form import UploadForm # noqa: E501
|
|
||||||
from openapi_server.test import BaseTestCase
|
|
||||||
|
|
||||||
|
|
||||||
class TestPetController(BaseTestCase):
|
|
||||||
"""PetController integration test stubs"""
|
|
||||||
|
|
||||||
@unittest.skip("Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760")
|
|
||||||
def test_add_pet(self):
|
|
||||||
"""Test case for add_pet
|
|
||||||
|
|
||||||
Add a new pet to the store
|
|
||||||
"""
|
|
||||||
pet = {
|
|
||||||
"photoUrls" : [ "photoUrls", "photoUrls" ],
|
|
||||||
"name" : "doggie",
|
|
||||||
"id" : 0,
|
|
||||||
"category" : {
|
|
||||||
"name" : "name",
|
|
||||||
"id" : 6
|
|
||||||
},
|
|
||||||
"tags" : [ {
|
|
||||||
"name" : "name",
|
|
||||||
"id" : 1
|
|
||||||
}, {
|
|
||||||
"name" : "name",
|
|
||||||
"id" : 1
|
|
||||||
} ],
|
|
||||||
"status" : "available"
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Authorization': 'Bearer special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet',
|
|
||||||
method='POST',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(pet),
|
|
||||||
content_type='application/json')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_delete_pet(self):
|
|
||||||
"""Test case for delete_pet
|
|
||||||
|
|
||||||
Deletes a pet
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
'api_key': 'api_key_example',
|
|
||||||
'Authorization': 'Bearer special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet/{pet_id}'.format(pet_id=56),
|
|
||||||
method='DELETE',
|
|
||||||
headers=headers)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_find_pets_by_status(self):
|
|
||||||
"""Test case for find_pets_by_status
|
|
||||||
|
|
||||||
Finds Pets by status
|
|
||||||
"""
|
|
||||||
query_string = [('status', 'available')]
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'Authorization': 'Bearer special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet/findByStatus',
|
|
||||||
method='GET',
|
|
||||||
headers=headers,
|
|
||||||
query_string=query_string)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_find_pets_by_tags(self):
|
|
||||||
"""Test case for find_pets_by_tags
|
|
||||||
|
|
||||||
Finds Pets by tags
|
|
||||||
"""
|
|
||||||
query_string = [('tags', 'tags_example')]
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'Authorization': 'Bearer special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet/findByTags',
|
|
||||||
method='GET',
|
|
||||||
headers=headers,
|
|
||||||
query_string=query_string)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_get_pet_by_id(self):
|
|
||||||
"""Test case for get_pet_by_id
|
|
||||||
|
|
||||||
Find pet by ID
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'api_key': 'special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet/{pet_id}'.format(pet_id=56),
|
|
||||||
method='GET',
|
|
||||||
headers=headers)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
@unittest.skip("Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760")
|
|
||||||
def test_update_pet(self):
|
|
||||||
"""Test case for update_pet
|
|
||||||
|
|
||||||
Update an existing pet
|
|
||||||
"""
|
|
||||||
pet = {
|
|
||||||
"photoUrls" : [ "photoUrls", "photoUrls" ],
|
|
||||||
"name" : "doggie",
|
|
||||||
"id" : 0,
|
|
||||||
"category" : {
|
|
||||||
"name" : "name",
|
|
||||||
"id" : 6
|
|
||||||
},
|
|
||||||
"tags" : [ {
|
|
||||||
"name" : "name",
|
|
||||||
"id" : 1
|
|
||||||
}, {
|
|
||||||
"name" : "name",
|
|
||||||
"id" : 1
|
|
||||||
} ],
|
|
||||||
"status" : "available"
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Authorization': 'Bearer special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet',
|
|
||||||
method='PUT',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(pet),
|
|
||||||
content_type='application/json')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_update_pet_status_with_enum(self):
|
|
||||||
"""Test case for update_pet_status_with_enum
|
|
||||||
|
|
||||||
Set the status of a pet in the store using an enum
|
|
||||||
"""
|
|
||||||
query_string = [('status', pending)]
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet/{pet_id}'.format(pet_id=56),
|
|
||||||
method='PATCH',
|
|
||||||
headers=headers,
|
|
||||||
query_string=query_string)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
@unittest.skip("application/x-www-form-urlencoded not supported by Connexion")
|
|
||||||
def test_update_pet_with_form(self):
|
|
||||||
"""Test case for update_pet_with_form
|
|
||||||
|
|
||||||
Updates a pet in the store with form data
|
|
||||||
"""
|
|
||||||
pet_form = {"name":"fluffy","status":"available"}
|
|
||||||
headers = {
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
'Authorization': 'Bearer special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet/{pet_id}'.format(pet_id=56),
|
|
||||||
method='POST',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(pet_form),
|
|
||||||
content_type='application/x-www-form-urlencoded')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
@unittest.skip("multipart/form-data not supported by Connexion")
|
|
||||||
def test_upload_file(self):
|
|
||||||
"""Test case for upload_file
|
|
||||||
|
|
||||||
uploads an image
|
|
||||||
"""
|
|
||||||
upload_form = {"additionalMetadata":"additional metadata example","file":"c29tZSB0ZXN0IGRhdGEK"}
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'Content-Type': 'multipart/form-data',
|
|
||||||
'Authorization': 'Bearer special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/pet/{pet_id}/uploadImage'.format(pet_id=56),
|
|
||||||
method='POST',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(upload_form),
|
|
||||||
content_type='multipart/form-data')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from flask import json
|
|
||||||
from io import BytesIO
|
|
||||||
|
|
||||||
from openapi_server.models.order import Order # noqa: E501
|
|
||||||
from openapi_server.test import BaseTestCase
|
|
||||||
|
|
||||||
|
|
||||||
class TestStoreController(BaseTestCase):
|
|
||||||
"""StoreController integration test stubs"""
|
|
||||||
|
|
||||||
def test_delete_order(self):
|
|
||||||
"""Test case for delete_order
|
|
||||||
|
|
||||||
Delete purchase order by ID
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/store/order/{order_id}'.format(order_id='order_id_example'),
|
|
||||||
method='DELETE',
|
|
||||||
headers=headers)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_get_inventory(self):
|
|
||||||
"""Test case for get_inventory
|
|
||||||
|
|
||||||
Returns pet inventories by status
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'api_key': 'special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/store/inventory',
|
|
||||||
method='GET',
|
|
||||||
headers=headers)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_get_order_by_id(self):
|
|
||||||
"""Test case for get_order_by_id
|
|
||||||
|
|
||||||
Find purchase order by ID
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/store/order/{order_id}'.format(order_id=5),
|
|
||||||
method='GET',
|
|
||||||
headers=headers)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_place_order(self):
|
|
||||||
"""Test case for place_order
|
|
||||||
|
|
||||||
Place an order for a pet
|
|
||||||
"""
|
|
||||||
order = {
|
|
||||||
"petId" : 6,
|
|
||||||
"quantity" : 1,
|
|
||||||
"id" : 0,
|
|
||||||
"shipDate" : "2000-01-23T04:56:07.000+00:00",
|
|
||||||
"complete" : false,
|
|
||||||
"status" : "placed"
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/store/order',
|
|
||||||
method='POST',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(order),
|
|
||||||
content_type='application/json')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -1,193 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
from flask import json
|
|
||||||
from io import BytesIO
|
|
||||||
|
|
||||||
from openapi_server.models.user import User # noqa: E501
|
|
||||||
from openapi_server.test import BaseTestCase
|
|
||||||
|
|
||||||
|
|
||||||
class TestUserController(BaseTestCase):
|
|
||||||
"""UserController integration test stubs"""
|
|
||||||
|
|
||||||
def test_create_user(self):
|
|
||||||
"""Test case for create_user
|
|
||||||
|
|
||||||
Create user
|
|
||||||
"""
|
|
||||||
user = {
|
|
||||||
"firstName" : "firstName",
|
|
||||||
"lastName" : "lastName",
|
|
||||||
"password" : "password",
|
|
||||||
"userStatus" : 6,
|
|
||||||
"phone" : "phone",
|
|
||||||
"id" : 0,
|
|
||||||
"email" : "email",
|
|
||||||
"username" : "username"
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'auth_cookie': 'special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/user',
|
|
||||||
method='POST',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(user),
|
|
||||||
content_type='application/json')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_create_users_with_array_input(self):
|
|
||||||
"""Test case for create_users_with_array_input
|
|
||||||
|
|
||||||
Creates list of users with given input array
|
|
||||||
"""
|
|
||||||
user = {
|
|
||||||
"firstName" : "firstName",
|
|
||||||
"lastName" : "lastName",
|
|
||||||
"password" : "password",
|
|
||||||
"userStatus" : 6,
|
|
||||||
"phone" : "phone",
|
|
||||||
"id" : 0,
|
|
||||||
"email" : "email",
|
|
||||||
"username" : "username"
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'auth_cookie': 'special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/user/createWithArray',
|
|
||||||
method='POST',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(user),
|
|
||||||
content_type='application/json')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_create_users_with_list_input(self):
|
|
||||||
"""Test case for create_users_with_list_input
|
|
||||||
|
|
||||||
Creates list of users with given input array
|
|
||||||
"""
|
|
||||||
user = {
|
|
||||||
"firstName" : "firstName",
|
|
||||||
"lastName" : "lastName",
|
|
||||||
"password" : "password",
|
|
||||||
"userStatus" : 6,
|
|
||||||
"phone" : "phone",
|
|
||||||
"id" : 0,
|
|
||||||
"email" : "email",
|
|
||||||
"username" : "username"
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'auth_cookie': 'special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/user/createWithList',
|
|
||||||
method='POST',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(user),
|
|
||||||
content_type='application/json')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_delete_user(self):
|
|
||||||
"""Test case for delete_user
|
|
||||||
|
|
||||||
Delete user
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
'auth_cookie': 'special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/user/{username}'.format(username='username_example'),
|
|
||||||
method='DELETE',
|
|
||||||
headers=headers)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_get_user_by_name(self):
|
|
||||||
"""Test case for get_user_by_name
|
|
||||||
|
|
||||||
Get user by user name
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/user/{username}'.format(username='username_example'),
|
|
||||||
method='GET',
|
|
||||||
headers=headers)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_login_user(self):
|
|
||||||
"""Test case for login_user
|
|
||||||
|
|
||||||
Logs user into the system
|
|
||||||
"""
|
|
||||||
query_string = [('username', 'username_example'),
|
|
||||||
('password', 'password_example')]
|
|
||||||
headers = {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/user/login',
|
|
||||||
method='GET',
|
|
||||||
headers=headers,
|
|
||||||
query_string=query_string)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_logout_user(self):
|
|
||||||
"""Test case for logout_user
|
|
||||||
|
|
||||||
Logs out current logged in user session
|
|
||||||
"""
|
|
||||||
headers = {
|
|
||||||
'auth_cookie': 'special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/user/logout',
|
|
||||||
method='GET',
|
|
||||||
headers=headers)
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
def test_update_user(self):
|
|
||||||
"""Test case for update_user
|
|
||||||
|
|
||||||
Updated user
|
|
||||||
"""
|
|
||||||
user = {
|
|
||||||
"firstName" : "firstName",
|
|
||||||
"lastName" : "lastName",
|
|
||||||
"password" : "password",
|
|
||||||
"userStatus" : 6,
|
|
||||||
"phone" : "phone",
|
|
||||||
"id" : 0,
|
|
||||||
"email" : "email",
|
|
||||||
"username" : "username"
|
|
||||||
}
|
|
||||||
headers = {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'auth_cookie': 'special-key',
|
|
||||||
}
|
|
||||||
response = self.client.open(
|
|
||||||
'/v2/user/{username}'.format(username='username_example'),
|
|
||||||
method='PUT',
|
|
||||||
headers=headers,
|
|
||||||
data=json.dumps(user),
|
|
||||||
content_type='application/json')
|
|
||||||
self.assert200(response,
|
|
||||||
'Response body is : ' + response.data.decode('utf-8'))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if sys.version_info < (3, 7):
|
|
||||||
import typing
|
|
||||||
|
|
||||||
def is_generic(klass):
|
|
||||||
""" Determine whether klass is a generic class """
|
|
||||||
return type(klass) == typing.GenericMeta
|
|
||||||
|
|
||||||
def is_dict(klass):
|
|
||||||
""" Determine whether klass is a Dict """
|
|
||||||
return klass.__extra__ == dict
|
|
||||||
|
|
||||||
def is_list(klass):
|
|
||||||
""" Determine whether klass is a List """
|
|
||||||
return klass.__extra__ == list
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
def is_generic(klass):
|
|
||||||
""" Determine whether klass is a generic class """
|
|
||||||
return hasattr(klass, '__origin__')
|
|
||||||
|
|
||||||
def is_dict(klass):
|
|
||||||
""" Determine whether klass is a Dict """
|
|
||||||
return klass.__origin__ == dict
|
|
||||||
|
|
||||||
def is_list(klass):
|
|
||||||
""" Determine whether klass is a List """
|
|
||||||
return klass.__origin__ == list
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
import datetime
|
|
||||||
|
|
||||||
import typing
|
|
||||||
from openapi_server import typing_utils
|
|
||||||
|
|
||||||
|
|
||||||
def _deserialize(data, klass):
|
|
||||||
"""Deserializes dict, list, str into an object.
|
|
||||||
|
|
||||||
:param data: dict, list or str.
|
|
||||||
:param klass: class literal, or string of class name.
|
|
||||||
|
|
||||||
:return: object.
|
|
||||||
"""
|
|
||||||
if data is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
if klass == int or klass in (float, str, bool, bytearray):
|
|
||||||
return _deserialize_primitive(data, klass)
|
|
||||||
elif klass == object:
|
|
||||||
return _deserialize_object(data)
|
|
||||||
elif klass == datetime.date:
|
|
||||||
return deserialize_date(data)
|
|
||||||
elif klass == datetime.datetime:
|
|
||||||
return deserialize_datetime(data)
|
|
||||||
elif typing_utils.is_generic(klass):
|
|
||||||
if typing_utils.is_list(klass):
|
|
||||||
return _deserialize_list(data, klass.__args__[0])
|
|
||||||
if typing_utils.is_dict(klass):
|
|
||||||
return _deserialize_dict(data, klass.__args__[1])
|
|
||||||
else:
|
|
||||||
return deserialize_model(data, klass)
|
|
||||||
|
|
||||||
|
|
||||||
def _deserialize_primitive(data, klass):
|
|
||||||
"""Deserializes to primitive type.
|
|
||||||
|
|
||||||
:param data: data to deserialize.
|
|
||||||
:param klass: class literal.
|
|
||||||
|
|
||||||
:return: int, long, float, str, bool.
|
|
||||||
:rtype: int | long | float | str | bool
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
value = klass(data)
|
|
||||||
except UnicodeEncodeError:
|
|
||||||
value = str(data)
|
|
||||||
except TypeError:
|
|
||||||
value = data
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def _deserialize_object(value):
|
|
||||||
"""Return an original value.
|
|
||||||
|
|
||||||
:return: object.
|
|
||||||
"""
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
def deserialize_date(string):
|
|
||||||
"""Deserializes string to date.
|
|
||||||
|
|
||||||
:param string: str.
|
|
||||||
:type string: str
|
|
||||||
:return: date.
|
|
||||||
:rtype: date
|
|
||||||
"""
|
|
||||||
if string is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
try:
|
|
||||||
from dateutil.parser import parse
|
|
||||||
return parse(string).date()
|
|
||||||
except ImportError:
|
|
||||||
return string
|
|
||||||
|
|
||||||
|
|
||||||
def deserialize_datetime(string):
|
|
||||||
"""Deserializes string to datetime.
|
|
||||||
|
|
||||||
The string should be in iso8601 datetime format.
|
|
||||||
|
|
||||||
:param string: str.
|
|
||||||
:type string: str
|
|
||||||
:return: datetime.
|
|
||||||
:rtype: datetime
|
|
||||||
"""
|
|
||||||
if string is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
try:
|
|
||||||
from dateutil.parser import parse
|
|
||||||
return parse(string)
|
|
||||||
except ImportError:
|
|
||||||
return string
|
|
||||||
|
|
||||||
|
|
||||||
def deserialize_model(data, klass):
|
|
||||||
"""Deserializes list or dict to model.
|
|
||||||
|
|
||||||
:param data: dict, list.
|
|
||||||
:type data: dict | list
|
|
||||||
:param klass: class literal.
|
|
||||||
:return: model object.
|
|
||||||
"""
|
|
||||||
instance = klass()
|
|
||||||
|
|
||||||
if not instance.openapi_types:
|
|
||||||
return data
|
|
||||||
|
|
||||||
for attr, attr_type in instance.openapi_types.items():
|
|
||||||
if data is not None \
|
|
||||||
and instance.attribute_map[attr] in data \
|
|
||||||
and isinstance(data, (list, dict)):
|
|
||||||
value = data[instance.attribute_map[attr]]
|
|
||||||
setattr(instance, attr, _deserialize(value, attr_type))
|
|
||||||
|
|
||||||
return instance
|
|
||||||
|
|
||||||
|
|
||||||
def _deserialize_list(data, boxed_type):
|
|
||||||
"""Deserializes a list and its elements.
|
|
||||||
|
|
||||||
:param data: list to deserialize.
|
|
||||||
:type data: list
|
|
||||||
:param boxed_type: class literal.
|
|
||||||
|
|
||||||
:return: deserialized list.
|
|
||||||
:rtype: list
|
|
||||||
"""
|
|
||||||
return [_deserialize(sub_data, boxed_type)
|
|
||||||
for sub_data in data]
|
|
||||||
|
|
||||||
|
|
||||||
def _deserialize_dict(data, boxed_type):
|
|
||||||
"""Deserializes a dict and its elements.
|
|
||||||
|
|
||||||
:param data: dict to deserialize.
|
|
||||||
:type data: dict
|
|
||||||
:param boxed_type: class literal.
|
|
||||||
|
|
||||||
:return: deserialized dict.
|
|
||||||
:rtype: dict
|
|
||||||
"""
|
|
||||||
return {k: _deserialize(v, boxed_type)
|
|
||||||
for k, v in data.items()}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
connexion[swagger-ui] >= 2.6.0; python_version>="3.6"
|
|
||||||
# 2.3 is the last version that supports python 3.4-3.5
|
|
||||||
connexion[swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=="3.4"
|
|
||||||
# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug
|
|
||||||
# we must peg werkzeug versions below to fix connexion
|
|
||||||
# https://github.com/zalando/connexion/pull/1044
|
|
||||||
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
|
|
||||||
swagger-ui-bundle >= 0.0.2
|
|
||||||
python_dateutil >= 2.6.0
|
|
||||||
setuptools >= 21.0.0
|
|
||||||
Flask == 2.1.1
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
import sys
|
|
||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
NAME = "openapi_server"
|
|
||||||
VERSION = "1.0.0"
|
|
||||||
|
|
||||||
# To install the library, run the following
|
|
||||||
#
|
|
||||||
# python setup.py install
|
|
||||||
#
|
|
||||||
# prerequisite: setuptools
|
|
||||||
# http://pypi.python.org/pypi/setuptools
|
|
||||||
|
|
||||||
REQUIRES = [
|
|
||||||
"connexion>=2.0.2",
|
|
||||||
"swagger-ui-bundle>=0.0.2",
|
|
||||||
"python_dateutil>=2.6.0"
|
|
||||||
]
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name=NAME,
|
|
||||||
version=VERSION,
|
|
||||||
description="OpenAPI Petstore",
|
|
||||||
author_email="",
|
|
||||||
url="",
|
|
||||||
keywords=["OpenAPI", "OpenAPI Petstore"],
|
|
||||||
install_requires=REQUIRES,
|
|
||||||
packages=find_packages(),
|
|
||||||
package_data={'': ['openapi/openapi.yaml']},
|
|
||||||
include_package_data=True,
|
|
||||||
entry_points={
|
|
||||||
'console_scripts': ['openapi_server=openapi_server.__main__:main']},
|
|
||||||
long_description="""\
|
|
||||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
pytest~=7.1.0
|
|
||||||
pytest-cov>=2.8.1
|
|
||||||
pytest-randomly>=1.2.3
|
|
||||||
Flask-Testing==0.8.1
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
[tox]
|
|
||||||
envlist = py3
|
|
||||||
skipsdist=True
|
|
||||||
|
|
||||||
[testenv]
|
|
||||||
deps=-r{toxinidir}/requirements.txt
|
|
||||||
-r{toxinidir}/test-requirements.txt
|
|
||||||
{toxinidir}
|
|
||||||
|
|
||||||
commands=
|
|
||||||
pytest --cov=openapi_server
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
<project>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>org.openapitools</groupId>
|
|
||||||
<artifactId>PythonAiohttpSrcLayoutServer</artifactId>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<name>Python Aiohttp Server (/src layout)</name>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy-dependencies</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>exec-maven-plugin</artifactId>
|
|
||||||
<version>1.2.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>test</id>
|
|
||||||
<phase>integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>exec</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<executable>make</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>test-all</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<project>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>org.openapitools</groupId>
|
|
||||||
<artifactId>PythonFastAPITests</artifactId>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<name>Python FastAPI Server</name>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy-dependencies</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.spotify</groupId>
|
|
||||||
<artifactId>dockerfile-maven-plugin</artifactId>
|
|
||||||
<version>1.4.13</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>test</id>
|
|
||||||
<phase>integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>build</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
REQUIREMENTS_OUT=test-requirements.txt.log
|
|
||||||
SETUP_OUT=*.egg-info
|
|
||||||
VENV=.venv
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(REQUIREMENTS_OUT)
|
|
||||||
rm -rf $(SETUP_OUT)
|
|
||||||
rm -rf $(VENV)
|
|
||||||
rm -rf .tox
|
|
||||||
rm -rf .coverage
|
|
||||||
find . -name "*.py[oc]" -delete
|
|
||||||
find . -name "__pycache__" -delete
|
|
||||||
|
|
||||||
test: clean
|
|
||||||
bash ./test_python3.sh
|
|
||||||
|
|
||||||
test-all: clean
|
|
||||||
bash ./test_python3.sh
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
tox
|
|
||||||
flake8
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
<project>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>org.openapitools</groupId>
|
|
||||||
<artifactId>PythonFlaskConnexionTests</artifactId>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<name>Python Flask Server</name>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy-dependencies</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>exec-maven-plugin</artifactId>
|
|
||||||
<version>1.2.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>test</id>
|
|
||||||
<phase>integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>exec</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<executable>make</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>test-all</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
REQUIREMENTS_FILE=dev-requirements.txt
|
|
||||||
REQUIREMENTS_OUT=dev-requirements.txt.log
|
|
||||||
SETUP_OUT=*.egg-info
|
|
||||||
VENV=.venv
|
|
||||||
DEACTIVE=false
|
|
||||||
|
|
||||||
export LC_ALL=en_US.UTF-8
|
|
||||||
export LANG=en_US.UTF-8
|
|
||||||
|
|
||||||
### set virtualenv
|
|
||||||
if [ -z "$VIRTUAL_ENV" ]; then
|
|
||||||
virtualenv $VENV --always-copy --python python3
|
|
||||||
source $VENV/bin/activate
|
|
||||||
DEACTIVE=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
### install dependencies
|
|
||||||
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
|
||||||
|
|
||||||
### run tests
|
|
||||||
tox || exit 1
|
|
||||||
|
|
||||||
### static analysis of code
|
|
||||||
#flake8 --show-source openapi_server/
|
|
||||||
|
|
||||||
### deactivate virtualenv
|
|
||||||
# if [ $DEACTIVE == true ]; then
|
|
||||||
# deactivate
|
|
||||||
# fi
|
|
||||||
Reference in New Issue
Block a user