[python] Fix data type (#16291)

* fix data type in python client codegen

* add model mapping feature
This commit is contained in:
William Cheng
2023-08-10 23:05:35 +08:00
committed by GitHub
parent 7a7309edb8
commit fd12bb3508
9 changed files with 462 additions and 24 deletions

View File

@@ -13,6 +13,7 @@ Method | HTTP request | Description
[**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 |
[**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int |
[**fake_return_list_of_objects**](FakeApi.md#fake_return_list_of_objects) | **GET** /fake/return_list_of_object | test returning list of objects
[**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary |
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
@@ -146,7 +147,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**200** | Get successful | - |
[[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)
@@ -672,6 +673,67 @@ 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)
# **fake_return_list_of_objects**
> List[List[Tag]] fake_return_list_of_objects()
test returning list of objects
### Example
```python
import time
import os
import petstore_api
from petstore_api.models.tag import Tag
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
try:
# test returning list of objects
api_response = api_instance.fake_return_list_of_objects()
print("The response of FakeApi->fake_return_list_of_objects:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FakeApi->fake_return_list_of_objects: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
**List[List[Tag]]**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
[[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_binary**
> test_body_with_binary(body)