forked from loafle/openapi-generator-original
fix: python clients (#136)
* fix: python client * fix: regenerate petstore samples for python-asyncio/tornado * fix: python-asyncio tests * fix: python-tornado tests * chore: update python samples * fix: enable tests for python-tornado * fix: discriminator property * fix: file type * python: regenerate samples * fix: define file as generic type
This commit is contained in:
committed by
William Cheng
parent
fdeca629bb
commit
d74d2ba031
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
||||
[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
|
||||
[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
|
||||
[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
|
||||
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
|
||||
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
|
||||
[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
|
||||
@@ -16,7 +17,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **fake_outer_boolean_serialize**
|
||||
> OuterBoolean fake_outer_boolean_serialize(body=body)
|
||||
> OuterBoolean fake_outer_boolean_serialize(boolean_post_body=boolean_post_body)
|
||||
|
||||
|
||||
|
||||
@@ -32,10 +33,10 @@ from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional)
|
||||
boolean_post_body = True # bool | Input boolean as post body (optional)
|
||||
|
||||
try:
|
||||
api_response = api_instance.fake_outer_boolean_serialize(body=body)
|
||||
api_response = api_instance.fake_outer_boolean_serialize(boolean_post_body=boolean_post_body)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
|
||||
@@ -45,7 +46,7 @@ except ApiException as e:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional]
|
||||
**boolean_post_body** | **bool**| Input boolean as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -58,12 +59,12 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **fake_outer_composite_serialize**
|
||||
> OuterComposite fake_outer_composite_serialize(body=body)
|
||||
> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite)
|
||||
|
||||
|
||||
|
||||
@@ -79,10 +80,10 @@ from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
|
||||
outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
|
||||
|
||||
try:
|
||||
api_response = api_instance.fake_outer_composite_serialize(body=body)
|
||||
api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
|
||||
@@ -92,7 +93,7 @@ except ApiException as e:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||
**outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -105,7 +106,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -126,7 +127,7 @@ from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional)
|
||||
body = 3.4 # float | Input number as post body (optional)
|
||||
|
||||
try:
|
||||
api_response = api_instance.fake_outer_number_serialize(body=body)
|
||||
@@ -139,7 +140,7 @@ except ApiException as e:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional]
|
||||
**body** | **float**| Input number as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -152,7 +153,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@@ -173,7 +174,7 @@ from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.OuterString() # OuterString | Input string as post body (optional)
|
||||
body = 'body_example' # str | Input string as post body (optional)
|
||||
|
||||
try:
|
||||
api_response = api_instance.fake_outer_string_serialize(body=body)
|
||||
@@ -186,7 +187,7 @@ except ApiException as e:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**OuterString**](OuterString.md)| Input string as post body | [optional]
|
||||
**body** | **str**| Input string as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -199,12 +200,58 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **test_body_with_query_params**
|
||||
> test_body_with_query_params(query, user)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi()
|
||||
query = 'query_example' # str |
|
||||
user = petstore_api.User() # User |
|
||||
|
||||
try:
|
||||
api_instance.test_body_with_query_params(query, user)
|
||||
except ApiException as e:
|
||||
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**query** | **str**| |
|
||||
**user** | [**User**](User.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **test_client_model**
|
||||
> Client test_client_model(body)
|
||||
> Client test_client_model(client)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
@@ -220,11 +267,11 @@ from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.Client() # Client | client model
|
||||
client = petstore_api.Client() # Client | client model
|
||||
|
||||
try:
|
||||
# To test \"client\" model
|
||||
api_response = api_instance.test_client_model(body)
|
||||
api_response = api_instance.test_client_model(client)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
|
||||
@@ -234,7 +281,7 @@ except ApiException as e:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -273,16 +320,16 @@ configuration.password = 'YOUR_PASSWORD'
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration))
|
||||
number = 8.14 # float | None
|
||||
double = 1.2 # float | None
|
||||
number = 3.4 # float | None
|
||||
double = 3.4 # float | None
|
||||
pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
|
||||
byte = 'B' # str | None
|
||||
byte = 'byte_example' # str | None
|
||||
integer = 56 # int | None (optional)
|
||||
int32 = 56 # int | None (optional)
|
||||
int64 = 789 # int | None (optional)
|
||||
int64 = 56 # int | None (optional)
|
||||
float = 3.4 # float | None (optional)
|
||||
string = 'string_example' # str | None (optional)
|
||||
binary = 'B' # str | None (optional)
|
||||
binary = '/path/to/file' # file | None (optional)
|
||||
date = '2013-10-20' # date | None (optional)
|
||||
date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
|
||||
password = 'password_example' # str | None (optional)
|
||||
@@ -308,7 +355,7 @@ Name | Type | Description | Notes
|
||||
**int64** | **int**| None | [optional]
|
||||
**float** | **float**| None | [optional]
|
||||
**string** | **str**| None | [optional]
|
||||
**binary** | **str**| None | [optional]
|
||||
**binary** | **file**| None | [optional]
|
||||
**date** | **date**| None | [optional]
|
||||
**date_time** | **datetime**| None | [optional]
|
||||
**password** | **str**| None | [optional]
|
||||
@@ -324,13 +371,13 @@ void (empty response body)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **test_enum_parameters**
|
||||
> test_enum_parameters(enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double)
|
||||
> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
|
||||
|
||||
To test enum parameters
|
||||
|
||||
@@ -346,18 +393,18 @@ from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi()
|
||||
enum_form_string_array = ['enum_form_string_array_example'] # list[str] | Form parameter enum test (string array) (optional)
|
||||
enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to -efg)
|
||||
enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional)
|
||||
enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to -efg)
|
||||
enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional)
|
||||
enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to -efg)
|
||||
enum_query_integer = 56 # int | Query parameter enum test (double) (optional)
|
||||
enum_query_double = 1.2 # float | Query parameter enum test (double) (optional)
|
||||
enum_query_double = 3.4 # float | Query parameter enum test (double) (optional)
|
||||
enum_form_string_array = NULL # list[str] | Form parameter enum test (string array) (optional)
|
||||
enum_form_string = 'enum_form_string_example' # str | Form parameter enum test (string) (optional)
|
||||
|
||||
try:
|
||||
# To test enum parameters
|
||||
api_instance.test_enum_parameters(enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string, enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double)
|
||||
api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
|
||||
except ApiException as e:
|
||||
print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e)
|
||||
```
|
||||
@@ -366,14 +413,14 @@ except ApiException as e:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional]
|
||||
**enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to -efg]
|
||||
**enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional]
|
||||
**enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to -efg]
|
||||
**enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional]
|
||||
**enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to -efg]
|
||||
**enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
|
||||
**enum_query_double** | **float**| Query parameter enum test (double) | [optional]
|
||||
**enum_form_string_array** | [**list[str]**](list.md)| Form parameter enum test (string array) | [optional]
|
||||
**enum_form_string** | **str**| Form parameter enum test (string) | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -385,18 +432,16 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: */*
|
||||
- **Accept**: */*
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **test_inline_additional_properties**
|
||||
> test_inline_additional_properties(param)
|
||||
> test_inline_additional_properties(request_body)
|
||||
|
||||
test inline additionalProperties
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
@@ -407,11 +452,11 @@ from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.FakeApi()
|
||||
param = NULL # object | request body
|
||||
request_body = {'key': 'request_body_example'} # str | request body
|
||||
|
||||
try:
|
||||
# test inline additionalProperties
|
||||
api_instance.test_inline_additional_properties(param)
|
||||
api_instance.test_inline_additional_properties(request_body)
|
||||
except ApiException as e:
|
||||
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
|
||||
```
|
||||
@@ -420,7 +465,7 @@ except ApiException as e:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | **object**| request body |
|
||||
**request_body** | [**str**](str.md)| request body |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -442,8 +487,6 @@ No authorization required
|
||||
|
||||
test json serialization of form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
@@ -481,7 +524,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
Reference in New Issue
Block a user