forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
commit
9c18c32b93
@ -862,6 +862,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
|
||||
- [HashData](http://www.hashdata.cn/)
|
||||
- [Hewlett Packard Enterprise](https://hpe.com)
|
||||
- [High Technologies Center](http://htc-cs.com)
|
||||
- [IBM](https://www.ibm.com)
|
||||
- [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications)
|
||||
- [Intent HQ](http://www.intenthq.com)
|
||||
- [Interactive Intelligence](http://developer.mypurecloud.com/)
|
||||
|
@ -434,7 +434,7 @@
|
||||
if (accept) {
|
||||
request.accept(accept);
|
||||
}
|
||||
|
||||
|
||||
if (returnType === 'Blob') {
|
||||
request.responseType('blob');
|
||||
}
|
||||
|
@ -97,10 +97,10 @@
|
||||
obj['string'] = ApiClient.convertToType(data['string'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('byte')) {
|
||||
obj['byte'] = ApiClient.convertToType(data['byte'], Blob);
|
||||
obj['byte'] = ApiClient.convertToType(data['byte'], 'Blob');
|
||||
}
|
||||
if (data.hasOwnProperty('binary')) {
|
||||
obj['binary'] = ApiClient.convertToType(data['binary'], Blob);
|
||||
obj['binary'] = ApiClient.convertToType(data['binary'], 'Blob');
|
||||
}
|
||||
if (data.hasOwnProperty('date')) {
|
||||
obj['date'] = ApiClient.convertToType(data['date'], 'Date');
|
||||
|
@ -443,7 +443,7 @@
|
||||
if (accept) {
|
||||
request.accept(accept);
|
||||
}
|
||||
|
||||
|
||||
if (returnType === 'Blob') {
|
||||
request.responseType('blob');
|
||||
}
|
||||
|
@ -97,10 +97,10 @@
|
||||
obj['string'] = ApiClient.convertToType(data['string'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('byte')) {
|
||||
obj['byte'] = ApiClient.convertToType(data['byte'], Blob);
|
||||
obj['byte'] = ApiClient.convertToType(data['byte'], 'Blob');
|
||||
}
|
||||
if (data.hasOwnProperty('binary')) {
|
||||
obj['binary'] = ApiClient.convertToType(data['binary'], Blob);
|
||||
obj['binary'] = ApiClient.convertToType(data['binary'], 'Blob');
|
||||
}
|
||||
if (data.hasOwnProperty('date')) {
|
||||
obj['date'] = ApiClient.convertToType(data['date'], 'Date');
|
||||
|
@ -0,0 +1,140 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Swagger 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: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
|
||||
# python 2 and python 3 compatibility library
|
||||
from six import iteritems
|
||||
|
||||
from ..api_client import ApiClient
|
||||
|
||||
|
||||
class FakeClassnameTags123Api(object):
|
||||
"""
|
||||
NOTE: This class is auto generated by the swagger code generator program.
|
||||
Do not edit the class manually.
|
||||
Ref: https://github.com/swagger-api/swagger-codegen
|
||||
"""
|
||||
|
||||
def __init__(self, api_client=None):
|
||||
if api_client is None:
|
||||
api_client = ApiClient()
|
||||
self.api_client = api_client
|
||||
|
||||
def test_classname(self, body, **kwargs):
|
||||
"""
|
||||
To test class name in snake case
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please define a `callback` function
|
||||
to be invoked when receiving the response.
|
||||
>>> def callback_function(response):
|
||||
>>> pprint(response)
|
||||
>>>
|
||||
>>> thread = api.test_classname(body, callback=callback_function)
|
||||
|
||||
:param callback function: The callback function
|
||||
for asynchronous request. (optional)
|
||||
:param Client body: client model (required)
|
||||
:return: Client
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('callback'):
|
||||
return self.test_classname_with_http_info(body, **kwargs)
|
||||
else:
|
||||
(data) = self.test_classname_with_http_info(body, **kwargs)
|
||||
return data
|
||||
|
||||
def test_classname_with_http_info(self, body, **kwargs):
|
||||
"""
|
||||
To test class name in snake case
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please define a `callback` function
|
||||
to be invoked when receiving the response.
|
||||
>>> def callback_function(response):
|
||||
>>> pprint(response)
|
||||
>>>
|
||||
>>> thread = api.test_classname_with_http_info(body, callback=callback_function)
|
||||
|
||||
:param callback function: The callback function
|
||||
for asynchronous request. (optional)
|
||||
:param Client body: client model (required)
|
||||
:return: Client
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body']
|
||||
all_params.append('callback')
|
||||
all_params.append('_return_http_data_only')
|
||||
all_params.append('_preload_content')
|
||||
all_params.append('_request_timeout')
|
||||
|
||||
params = locals()
|
||||
for key, val in iteritems(params['kwargs']):
|
||||
if key not in all_params:
|
||||
raise TypeError(
|
||||
"Got an unexpected keyword argument '%s'"
|
||||
" to method test_classname" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params) or (params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `test_classname`")
|
||||
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = {}
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.\
|
||||
select_header_accept(['application/json'])
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.\
|
||||
select_header_content_type(['application/json'])
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = []
|
||||
|
||||
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_type='Client',
|
||||
auth_settings=auth_settings,
|
||||
callback=params.get('callback'),
|
||||
_return_http_data_only=params.get('_return_http_data_only'),
|
||||
_preload_content=params.get('_preload_content', True),
|
||||
_request_timeout=params.get('_request_timeout'),
|
||||
collection_formats=collection_formats)
|
@ -0,0 +1,44 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Swagger 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: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.apis.fake_classname_tags_123_api import FakeClassnameTags123Api
|
||||
|
||||
|
||||
class TestFakeClassnameTags123Api(unittest.TestCase):
|
||||
""" FakeClassnameTags123Api unit test stubs """
|
||||
|
||||
def setUp(self):
|
||||
self.api = petstore_api.apis.fake_classname_tags_123_api.FakeClassnameTags123Api()
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def test_test_classname(self):
|
||||
"""
|
||||
Test case for test_classname
|
||||
|
||||
To test class name in snake case
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user