mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 08:46:55 +00:00
[python-client] Modify python templates to resolve linting errors (#6839)
The linting results for the generated samples are as follows where the first number is the BEFORE and the second is AFTER. pyclient 7714 vs. 120 pyclient3 7717 vs. 120 pyclient3-asyncio 7584 vs. 120 pyclient-tornado 7633 vs. 120 pyclient3-tornado 7633 vs. 120 For the complete details please see the following gist. https://gist.github.com/kenjones-cisco/2eb69a7e8db75e9fd53789f01570d9f2 Enforces linting for python clients by running flake8 for the generated python client.
This commit is contained in:
@@ -11,6 +11,7 @@ Method | HTTP request | Description
|
||||
[**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
|
||||
[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
|
||||
|
||||
@@ -21,7 +22,7 @@ Method | HTTP request | Description
|
||||
|
||||
Test serialization of outer boolean types
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -33,7 +34,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional)
|
||||
|
||||
try:
|
||||
try:
|
||||
api_response = api_instance.fake_outer_boolean_serialize(body=body)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
@@ -68,7 +69,7 @@ No authorization required
|
||||
|
||||
Test serialization of object with outer number type
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -80,7 +81,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
|
||||
|
||||
try:
|
||||
try:
|
||||
api_response = api_instance.fake_outer_composite_serialize(body=body)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
@@ -115,7 +116,7 @@ No authorization required
|
||||
|
||||
Test serialization of outer number types
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -127,7 +128,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional)
|
||||
|
||||
try:
|
||||
try:
|
||||
api_response = api_instance.fake_outer_number_serialize(body=body)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
@@ -162,7 +163,7 @@ No authorization required
|
||||
|
||||
Test serialization of outer string types
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -174,7 +175,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.OuterString() # OuterString | Input string as post body (optional)
|
||||
|
||||
try:
|
||||
try:
|
||||
api_response = api_instance.fake_outer_string_serialize(body=body)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
@@ -209,7 +210,7 @@ To test \"client\" model
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -221,7 +222,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.FakeApi()
|
||||
body = petstore_api.Client() # Client | client model
|
||||
|
||||
try:
|
||||
try:
|
||||
# To test \"client\" model
|
||||
api_response = api_instance.test_client_model(body)
|
||||
pprint(api_response)
|
||||
@@ -257,7 +258,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -287,7 +288,7 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
|
||||
password = 'password_example' # str | None (optional)
|
||||
param_callback = 'param_callback_example' # str | None (optional)
|
||||
|
||||
try:
|
||||
try:
|
||||
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
|
||||
except ApiException as e:
|
||||
@@ -335,7 +336,7 @@ To test enum parameters
|
||||
|
||||
To test enum parameters
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -354,7 +355,7 @@ enum_query_string = '-efg' # str | Query parameter enum test (string) (optional)
|
||||
enum_query_integer = 56 # int | Query parameter enum test (double) (optional)
|
||||
enum_query_double = 1.2 # float | Query parameter enum test (double) (optional)
|
||||
|
||||
try:
|
||||
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)
|
||||
except ApiException as e:
|
||||
@@ -389,6 +390,53 @@ No authorization required
|
||||
|
||||
[[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 additionalProperties
|
||||
|
||||
|
||||
|
||||
### 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()
|
||||
param = NULL # object | request body
|
||||
|
||||
try:
|
||||
# test inline additionalProperties
|
||||
api_instance.test_inline_additional_properties(param)
|
||||
except ApiException as e:
|
||||
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | **object**| request body |
|
||||
|
||||
### 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_json_form_data**
|
||||
> test_json_form_data(param, param2)
|
||||
|
||||
@@ -396,7 +444,7 @@ test json serialization of form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -409,7 +457,7 @@ api_instance = petstore_api.FakeApi()
|
||||
param = 'param_example' # str | field1
|
||||
param2 = 'param2_example' # str | field2
|
||||
|
||||
try:
|
||||
try:
|
||||
# test json serialization of form data
|
||||
api_instance.test_json_form_data(param, param2)
|
||||
except ApiException as e:
|
||||
|
||||
Reference in New Issue
Block a user