forked from loafle/openapi-generator-original
fix typo, update documentation for python lib
This commit is contained in:
parent
3f8dbf416d
commit
2251a2f892
@ -61,7 +61,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
"return", "def", "for", "lambda", "try"));
|
"return", "def", "for", "lambda", "try"));
|
||||||
|
|
||||||
cliOptions.clear();
|
cliOptions.clear();
|
||||||
cliOptions.add(new CliOption("packageName", "python package name (convension: under_score), default: swagger_client"));
|
cliOptions.add(new CliOption("packageName", "python package name (convention: under_score), default: swagger_client"));
|
||||||
cliOptions.add(new CliOption("packageVersion", "python package version, default: 1.0.0"));
|
cliOptions.add(new CliOption("packageVersion", "python package version, default: 1.0.0"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class {{classname}}(object):
|
|||||||
"""
|
"""
|
||||||
NOTE: This class is auto generated by the swagger code generator program.
|
NOTE: This class is auto generated by the swagger code generator program.
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
|
Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, api_client=None):
|
def __init__(self, api_client=None):
|
||||||
@ -51,7 +52,7 @@ class {{classname}}(object):
|
|||||||
{{{summary}}}
|
{{{summary}}}
|
||||||
{{{notes}}}
|
{{{notes}}}
|
||||||
|
|
||||||
This method makes a synchronous HTTP request by default.To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please define a `callback` function
|
asynchronous HTTP request, please define a `callback` function
|
||||||
to be invoked when receiving the response.
|
to be invoked when receiving the response.
|
||||||
>>> def callback_function(response):
|
>>> def callback_function(response):
|
||||||
|
@ -14,6 +14,8 @@ Copyright 2015 SmartBear Software
|
|||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
@ -56,7 +58,7 @@ class ApiClient(object):
|
|||||||
templates.
|
templates.
|
||||||
|
|
||||||
NOTE: This class is auto generated by the swagger code generator program.
|
NOTE: This class is auto generated by the swagger code generator program.
|
||||||
https://github.com/swagger-api/swagger-codegen
|
Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
|
|
||||||
:param host: The base path for the server to call.
|
:param host: The base path for the server to call.
|
||||||
@ -75,7 +77,7 @@ class ApiClient(object):
|
|||||||
self.host = host
|
self.host = host
|
||||||
self.cookie = cookie
|
self.cookie = cookie
|
||||||
# Set default User-Agent.
|
# Set default User-Agent.
|
||||||
self.user_agent = 'Python-Swagger'
|
self.user_agent = 'Python-Swagger/{{packageVersion}}'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user_agent(self):
|
def user_agent(self):
|
||||||
@ -280,7 +282,8 @@ class ApiClient(object):
|
|||||||
body=None, post_params=None, files=None,
|
body=None, post_params=None, files=None,
|
||||||
response_type=None, auth_settings=None, callback=None):
|
response_type=None, auth_settings=None, callback=None):
|
||||||
"""
|
"""
|
||||||
Makes the HTTP request and return the deserialized data.
|
Makes the HTTP request (synchronous) and return the deserialized data.
|
||||||
|
To make an async request, define a function for callback.
|
||||||
|
|
||||||
:param resource_path: Path to method endpoint.
|
:param resource_path: Path to method endpoint.
|
||||||
:param method: Method to call.
|
:param method: Method to call.
|
||||||
@ -450,9 +453,8 @@ class ApiClient(object):
|
|||||||
|
|
||||||
def __deserialize_file(self, response):
|
def __deserialize_file(self, response):
|
||||||
"""
|
"""
|
||||||
Saves response body into a file in (the defined) temporary folder,
|
Saves response body into a file in a temporary folder,
|
||||||
using the filename from the `Content-Disposition` header if provided,
|
using the filename from the `Content-Disposition` header if provided.
|
||||||
otherwise a random filename.
|
|
||||||
|
|
||||||
:param response: RESTResponse.
|
:param response: RESTResponse.
|
||||||
:return: file path.
|
:return: file path.
|
||||||
|
@ -14,6 +14,8 @@ Copyright 2015 SmartBear Software
|
|||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
|
ref: https://github.com/swagger-api/swagger-codegen
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
@ -44,7 +46,7 @@ def singleton(cls, *args, **kw):
|
|||||||
class Configuration(object):
|
class Configuration(object):
|
||||||
"""
|
"""
|
||||||
NOTE: This class is auto generated by the swagger code generator program.
|
NOTE: This class is auto generated by the swagger code generator program.
|
||||||
https://github.com/swagger-api/swagger-codegen
|
Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -56,7 +58,7 @@ class Configuration(object):
|
|||||||
self.host = "{{basePath}}"
|
self.host = "{{basePath}}"
|
||||||
# Default api client
|
# Default api client
|
||||||
self.api_client = None
|
self.api_client = None
|
||||||
# Temp file folder for download
|
# Temp file folder for downloading files
|
||||||
self.temp_folder_path = None
|
self.temp_folder_path = None
|
||||||
|
|
||||||
# Authentication Settings
|
# Authentication Settings
|
||||||
@ -139,7 +141,7 @@ class Configuration(object):
|
|||||||
|
|
||||||
def get_basic_auth_token(self):
|
def get_basic_auth_token(self):
|
||||||
"""
|
"""
|
||||||
Gets basic auth header string.
|
Gets HTTP basic authentication header (string).
|
||||||
|
|
||||||
:return: The token for basic HTTP authentication.
|
:return: The token for basic HTTP authentication.
|
||||||
"""
|
"""
|
||||||
|
@ -14,6 +14,8 @@ Copyright 2015 SmartBear Software
|
|||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
|
Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
"""
|
"""
|
||||||
|
|
||||||
{{#models}}
|
{{#models}}
|
||||||
@ -29,7 +31,7 @@ class {{classname}}(object):
|
|||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""
|
"""
|
||||||
Swagger model
|
{{classname}} - a model defined in Swagger
|
||||||
|
|
||||||
:param dict swaggerTypes: The key is attribute name
|
:param dict swaggerTypes: The key is attribute name
|
||||||
and the value is attribute type.
|
and the value is attribute type.
|
||||||
@ -82,7 +84,7 @@ class {{classname}}(object):
|
|||||||
{{/vars}}
|
{{/vars}}
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""
|
"""
|
||||||
Return model properties dict
|
Returns the model properties as a dict
|
||||||
"""
|
"""
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
@ -102,7 +104,7 @@ class {{classname}}(object):
|
|||||||
|
|
||||||
def to_str(self):
|
def to_str(self):
|
||||||
"""
|
"""
|
||||||
Return model properties str
|
Returns the string representation of the model
|
||||||
"""
|
"""
|
||||||
return pformat(self.to_dict())
|
return pformat(self.to_dict())
|
||||||
|
|
||||||
|
@ -8,13 +8,11 @@ VERSION = "{{packageVersion}}"
|
|||||||
|
|
||||||
{{#apiInfo}}{{#apis}}{{^hasMore}}
|
{{#apiInfo}}{{#apis}}{{^hasMore}}
|
||||||
|
|
||||||
# To install the library, open a Terminal shell, then run this
|
# To install the library, run the following
|
||||||
# file by typing:
|
|
||||||
#
|
#
|
||||||
# python setup.py install
|
# python setup.py install
|
||||||
#
|
#
|
||||||
# You need to have the setuptools module installed.
|
# prerequisite: setuptools
|
||||||
# Try reading the setuptools documentation:
|
|
||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = ["urllib3 >= 1.10", "six >= 1.9", "certifi", "python-dateutil"]
|
REQUIRES = ["urllib3 >= 1.10", "six >= 1.9", "certifi", "python-dateutil"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user