From b3bfa1ef3bf969dc6d9738881e0debb4767a507f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Mar 2023 14:52:54 +0800 Subject: [PATCH] use Any instead of StrictStr in any type (#14995) --- .../languages/PythonNextgenClientCodegen.java | 12 +- ...ith-fake-endpoints-models-for-testing.yaml | 14 ++ .../openapi_client/api/query_api.py | 12 +- .../petstore/python-nextgen-aiohttp/README.md | 1 + .../python-nextgen-aiohttp/docs/FakeApi.md | 61 +++++++ .../petstore_api/api/fake_api.py | 151 +++++++++++++++++- .../client/petstore/python-nextgen/README.md | 1 + .../petstore/python-nextgen/docs/FakeApi.md | 61 +++++++ .../petstore_api/api/fake_api.py | 141 +++++++++++++++- 9 files changed, 440 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java index b2bb11e4f37..97ef3daa7fb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonNextgenClientCodegen.java @@ -422,9 +422,9 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements Set modelImports) { if (cp == null) { // if codegen parameter (e.g. map/dict of undefined type) is null, default to string - LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to string (StrictStr in Pydantic)"); - pydanticImports.add("StrictStr"); - return "StrictStr"; + LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any."); + typingImports.add("Any"); + return "Any"; } if (cp.isArray) { @@ -651,9 +651,9 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements Set modelImports) { if (cp == null) { // if codegen property (e.g. map/dict of undefined type) is null, default to string - LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to string (StrictStr in Pydantic)"); - pydanticImports.add("StrictStr"); - return "StrictStr"; + LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any."); + typingImports.add("Any"); + return "Any"; } if (cp.isEnum) { diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml index 24a7dd47d53..ac9df8980a4 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1234,6 +1234,20 @@ paths: responses: 200: description: The instance started successfully + /fake/any_type_body: + post: + tags: + - fake + summary: test any type request body + operationId: fakeAnyTypeRequestBody + requestBody: + content: + application/json: + schema: + type: object + responses: + 200: + description: OK servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server diff --git a/samples/client/echo_api/python-nextgen/openapi_client/api/query_api.py b/samples/client/echo_api/python-nextgen/openapi_client/api/query_api.py index fd624a242e0..c5782a008e8 100644 --- a/samples/client/echo_api/python-nextgen/openapi_client/api/query_api.py +++ b/samples/client/echo_api/python-nextgen/openapi_client/api/query_api.py @@ -365,7 +365,7 @@ class QueryApi(object): _request_auth=_params.get('_request_auth')) @validate_arguments - def test_query_style_deep_object_explode_true_object(self, query_object : Optional[Dict[str, Dict[str, StrictStr]]] = None, **kwargs) -> str: # noqa: E501 + def test_query_style_deep_object_explode_true_object(self, query_object : Optional[Dict[str, Dict[str, Any]]] = None, **kwargs) -> str: # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -396,7 +396,7 @@ class QueryApi(object): return self.test_query_style_deep_object_explode_true_object_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments - def test_query_style_deep_object_explode_true_object_with_http_info(self, query_object : Optional[Dict[str, Dict[str, StrictStr]]] = None, **kwargs): # noqa: E501 + def test_query_style_deep_object_explode_true_object_with_http_info(self, query_object : Optional[Dict[str, Dict[str, Any]]] = None, **kwargs): # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -645,7 +645,7 @@ class QueryApi(object): _request_auth=_params.get('_request_auth')) @validate_arguments - def test_query_style_form_explode_true_array_string(self, query_object : Optional[Dict[str, StrictStr]] = None, **kwargs) -> str: # noqa: E501 + def test_query_style_form_explode_true_array_string(self, query_object : Optional[Dict[str, Any]] = None, **kwargs) -> str: # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -676,7 +676,7 @@ class QueryApi(object): return self.test_query_style_form_explode_true_array_string_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments - def test_query_style_form_explode_true_array_string_with_http_info(self, query_object : Optional[Dict[str, StrictStr]] = None, **kwargs): # noqa: E501 + def test_query_style_form_explode_true_array_string_with_http_info(self, query_object : Optional[Dict[str, Any]] = None, **kwargs): # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -785,7 +785,7 @@ class QueryApi(object): _request_auth=_params.get('_request_auth')) @validate_arguments - def test_query_style_form_explode_true_object(self, query_object : Optional[Dict[str, StrictStr]] = None, **kwargs) -> str: # noqa: E501 + def test_query_style_form_explode_true_object(self, query_object : Optional[Dict[str, Any]] = None, **kwargs) -> str: # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 @@ -816,7 +816,7 @@ class QueryApi(object): return self.test_query_style_form_explode_true_object_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments - def test_query_style_form_explode_true_object_with_http_info(self, query_object : Optional[Dict[str, StrictStr]] = None, **kwargs): # noqa: E501 + def test_query_style_form_explode_true_object_with_http_info(self, query_object : Optional[Dict[str, Any]] = None, **kwargs): # noqa: E501 """Test query parameter(s) # noqa: E501 Test query parameter(s) # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md index 2a6511e7b74..be281eb9946 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/README.md @@ -88,6 +88,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_any_type_request_body**](docs/FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md index c819e37193f..e8970e82d3c 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fake_any_type_request_body**](FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | @@ -23,6 +24,66 @@ Method | HTTP request | Description [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | +# **fake_any_type_request_body** +> fake_any_type_request_body(body=body) + +test any type request body + +### Example + +```python +from __future__ import print_function +import time +import os +import petstore_api +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 +async with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = None # object | (optional) + + try: + # test any type request body + await api_instance.fake_any_type_request_body(body=body) + except Exception as e: + print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **object**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### 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) + # **fake_health_get** > HealthCheckResult fake_health_get() diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py index a705d5af6e7..4b9d11adc68 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/petstore_api/api/fake_api.py @@ -24,7 +24,7 @@ from datetime import date, datetime from pydantic import Field, StrictBool, StrictInt, StrictStr, confloat, conint, conlist, constr, validator -from typing import Dict, Optional +from typing import Any, Dict, Optional from petstore_api.models.client import Client from petstore_api.models.file_schema_test_class import FileSchemaTestClass @@ -53,6 +53,155 @@ class FakeApi(object): api_client = ApiClient.get_default() self.api_client = api_client + @overload + async def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, **kwargs) -> None: # noqa: E501 + ... + + @overload + def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, async_req: Optional[bool]=True, **kwargs) -> None: # noqa: E501 + ... + + @validate_arguments + def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, async_req: Optional[bool]=None, **kwargs) -> Union[None, Awaitable[None]]: # noqa: E501 + """test any type request body # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fake_any_type_request_body(body, async_req=True) + >>> result = thread.get() + + :param body: + :type body: object + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + if async_req is not None: + kwargs['async_req'] = async_req + return self.fake_any_type_request_body_with_http_info(body, **kwargs) # noqa: E501 + + @validate_arguments + def fake_any_type_request_body_with_http_info(self, body : Optional[Dict[str, Any]] = None, **kwargs): # noqa: E501 + """test any type request body # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fake_any_type_request_body_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: + :type body: object + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'body' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_any_type_request_body" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['body']: + _body_params = _params['body'] + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/fake/any_type_body', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @overload async def fake_health_get(self, **kwargs) -> HealthCheckResult: # noqa: E501 ... diff --git a/samples/openapi3/client/petstore/python-nextgen/README.md b/samples/openapi3/client/petstore/python-nextgen/README.md index 00f4adf15c5..c5e730e2862 100755 --- a/samples/openapi3/client/petstore/python-nextgen/README.md +++ b/samples/openapi3/client/petstore/python-nextgen/README.md @@ -88,6 +88,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_any_type_request_body**](docs/FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md index 4407e642760..83ceaf660d5 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fake_any_type_request_body**](FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint [**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | @@ -23,6 +24,66 @@ Method | HTTP request | Description [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | +# **fake_any_type_request_body** +> fake_any_type_request_body(body=body) + +test any type request body + +### Example + +```python +from __future__ import print_function +import time +import os +import petstore_api +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) + body = None # object | (optional) + + try: + # test any type request body + api_instance.fake_any_type_request_body(body=body) + except Exception as e: + print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **object**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### 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) + # **fake_health_get** > HealthCheckResult fake_health_get() diff --git a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py index 27d18a0e091..8ce851d9f06 100755 --- a/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-nextgen/petstore_api/api/fake_api.py @@ -23,7 +23,7 @@ from datetime import date, datetime from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, confloat, conint, conlist, constr, validator -from typing import Dict, Optional +from typing import Any, Dict, Optional from petstore_api.models.client import Client from petstore_api.models.file_schema_test_class import FileSchemaTestClass @@ -52,6 +52,145 @@ class FakeApi(object): api_client = ApiClient.get_default() self.api_client = api_client + @validate_arguments + def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, **kwargs) -> None: # noqa: E501 + """test any type request body # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fake_any_type_request_body(body, async_req=True) + >>> result = thread.get() + + :param body: + :type body: object + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + return self.fake_any_type_request_body_with_http_info(body, **kwargs) # noqa: E501 + + @validate_arguments + def fake_any_type_request_body_with_http_info(self, body : Optional[Dict[str, Any]] = None, **kwargs): # noqa: E501 + """test any type request body # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fake_any_type_request_body_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: + :type body: object + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [ + 'body' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_any_type_request_body" % _key + ) + _params[_key] = _val + del _params['kwargs'] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get('_headers', {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params['body']: + _body_params = _params['body'] + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return self.api_client.call_api( + '/fake/any_type_body', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments def fake_health_get(self, **kwargs) -> HealthCheckResult: # noqa: E501 """Health check endpoint # noqa: E501