From a333e98641700b33395eeef1577c102b88283b90 Mon Sep 17 00:00:00 2001 From: the-akhil-nair Date: Thu, 26 May 2022 19:18:22 -0400 Subject: [PATCH] [getiem_all_of_bug] Updated test cases, docs and samples. --- ...odels-for-testing-with-http-signature.yaml | 17 +++++ .../client/petstore/python/test/test_child.py | 6 +- .../client/petstore/python/test/test_dog.py | 6 +- .../openapi3/client/petstore/python/README.md | 1 + .../client/petstore/python/docs/FakeApi.md | 66 +++++++++++++++++++ .../python/petstore_api/api/fake_api.py | 57 ++++++++-------- 6 files changed, 121 insertions(+), 32 deletions(-) diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 2f4ce208f363..8d040105b98d 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -1365,6 +1365,23 @@ paths: application/json: schema: $ref: '#/components/schemas/GmFruitNoProperties' + /fake/TxRxAllOfModel: + post: + tags: + - fake + operationId: txRxAllOfModel + responses: + 200: + description: success + content: + application/json: + schema: + $ref: '#/components/schemas/StreamOptions' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StreamOptions' servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server diff --git a/samples/client/petstore/python/test/test_child.py b/samples/client/petstore/python/test/test_child.py index 88e6b9ed4a8e..dea4e6010967 100644 --- a/samples/client/petstore/python/test/test_child.py +++ b/samples/client/petstore/python/test/test_child.py @@ -115,9 +115,9 @@ def testChild(self): self.assertEqual( child._var_name_to_model_instances, { - 'radio_waves': [child, child_allof_instance, parent_instance], - 'tele_vision': [child, child_allof_instance, parent_instance], - 'inter_net': [child, child_allof_instance, parent_instance] + 'radio_waves': [child, parent_instance], + 'tele_vision': [child, parent_instance], + 'inter_net': [child, child_allof_instance] } ) # model._additional_properties_model_instances stores a list of diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python/test/test_dog.py index 0352d794c928..5f6a38b929c6 100644 --- a/samples/client/petstore/python/test/test_dog.py +++ b/samples/client/petstore/python/test/test_dog.py @@ -112,9 +112,9 @@ def testDog(self): self.assertEqual( dog._var_name_to_model_instances, { - 'breed': [dog, animal_instance, dog_allof_instance], - 'class_name': [dog, animal_instance, dog_allof_instance], - 'color': [dog, animal_instance, dog_allof_instance] + 'breed': [dog, dog_allof_instance], + 'class_name': [dog, animal_instance], + 'color': [dog, animal_instance] } ) # model._additional_properties_model_instances stores a list of diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 686adf1fbd88..d877696d65f3 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -107,6 +107,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**tx_rx_all_of_model**](docs/FakeApi.md#tx_rx_all_of_model) | **POST** /fake/TxRxAllOfModel | *FakeApi* | [**tx_rx_any_of_model**](docs/FakeApi.md#tx_rx_any_of_model) | **POST** /fake/TxRxAnyOfModel | *FakeApi* | [**upload_download_file**](docs/FakeApi.md#upload_download_file) | **POST** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream *FakeApi* | [**upload_file**](docs/FakeApi.md#upload_file) | **POST** /fake/uploadFile | uploads a file using multipart/form-data diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index bd469c3c2aff..97d25d3a0176 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -28,6 +28,7 @@ Method | HTTP request | Description [**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 [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters | +[**tx_rx_all_of_model**](FakeApi.md#tx_rx_all_of_model) | **POST** /fake/TxRxAllOfModel | [**tx_rx_any_of_model**](FakeApi.md#tx_rx_any_of_model) | **POST** /fake/TxRxAnyOfModel | [**upload_download_file**](FakeApi.md#upload_download_file) | **POST** /fake/uploadDownloadFile | uploads a file and downloads a file using application/octet-stream [**upload_file**](FakeApi.md#upload_file) | **POST** /fake/uploadFile | uploads a file using multipart/form-data @@ -1794,6 +1795,71 @@ 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) +# **tx_rx_all_of_model** +> StreamOptions tx_rx_all_of_model() + + + +### Example + + +```python +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model.stream_options import StreamOptions +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() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + stream_options = StreamOptions(None) # StreamOptions | (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.tx_rx_all_of_model(stream_options=stream_options) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->tx_rx_all_of_model: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **stream_options** | [**StreamOptions**](StreamOptions.md)| | [optional] + +### Return type + +[**StreamOptions**](StreamOptions.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | success | - | + +[[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) + # **tx_rx_any_of_model** > GmFruitNoProperties tx_rx_any_of_model() diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 7cbb0b378219..a8e94f10e5b4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -30,13 +30,13 @@ from petstore_api.model.enum_test import EnumTest from petstore_api.model.file_schema_test_class import FileSchemaTestClass from petstore_api.model.gm_fruit_no_properties import GmFruitNoProperties -from petstore_api.model.stream_options import StreamOptions from petstore_api.model.health_check_result import HealthCheckResult from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload from petstore_api.model.mammal import Mammal from petstore_api.model.number_with_validations import NumberWithValidations from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps from petstore_api.model.post_inline_additional_properties_payload_request import PostInlineAdditionalPropertiesPayloadRequest +from petstore_api.model.stream_options import StreamOptions from petstore_api.model.string_enum import StringEnum from petstore_api.model.user import User @@ -1486,18 +1486,18 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.tx_rx_any_of_model_endpoint = _Endpoint( + self.tx_rx_all_of_model_endpoint = _Endpoint( settings={ - 'response_type': (GmFruitNoProperties,), + 'response_type': (StreamOptions,), 'auth': [], - 'endpoint_path': '/fake/TxRxAnyOfModel', - 'operation_id': 'tx_rx_any_of_model', + 'endpoint_path': '/fake/TxRxAllOfModel', + 'operation_id': 'tx_rx_all_of_model', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ - 'gm_fruit_no_properties', + 'stream_options', ], 'required': [], 'nullable': [ @@ -1513,13 +1513,13 @@ def __init__(self, api_client=None): 'allowed_values': { }, 'openapi_types': { - 'gm_fruit_no_properties': - (GmFruitNoProperties,), + 'stream_options': + (StreamOptions,), }, 'attribute_map': { }, 'location_map': { - 'gm_fruit_no_properties': 'body', + 'stream_options': 'body', }, 'collection_format_map': { } @@ -1534,18 +1534,18 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.tx_rx_all_of_model_endpoint = _Endpoint( + self.tx_rx_any_of_model_endpoint = _Endpoint( settings={ - 'response_type': (StreamOptions,), + 'response_type': (GmFruitNoProperties,), 'auth': [], - 'endpoint_path': '/fake/TxRxAllOfModel', - 'operation_id': 'tx_rx_all_of_model', + 'endpoint_path': '/fake/TxRxAnyOfModel', + 'operation_id': 'tx_rx_any_of_model', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ - 'stream_options', + 'gm_fruit_no_properties', ], 'required': [], 'nullable': [ @@ -1561,13 +1561,13 @@ def __init__(self, api_client=None): 'allowed_values': { }, 'openapi_types': { - 'stream_options': - (StreamOptions,), + 'gm_fruit_no_properties': + (GmFruitNoProperties,), }, 'attribute_map': { }, 'location_map': { - 'stream_options': 'body', + 'gm_fruit_no_properties': 'body', }, 'collection_format_map': { } @@ -3730,21 +3730,21 @@ def test_query_parameter_collection_format( context return self.test_query_parameter_collection_format_endpoint.call_with_http_info(**kwargs) - def tx_rx_any_of_model( + def tx_rx_all_of_model( self, **kwargs ): - """tx_rx_any_of_model # noqa: E501 + """tx_rx_all_of_model # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tx_rx_any_of_model(async_req=True) + >>> thread = api.tx_rx_all_of_model(async_req=True) >>> result = thread.get() Keyword Args: - gm_fruit_no_properties (GmFruitNoProperties): [optional] + stream_options (StreamOptions): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -3777,7 +3777,7 @@ def tx_rx_any_of_model( async_req (bool): execute request asynchronously Returns: - GmFruitNoProperties + StreamOptions If the method is called asynchronously, returns the request thread. """ @@ -3806,19 +3806,23 @@ def tx_rx_any_of_model( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.tx_rx_any_of_model_endpoint.call_with_http_info(**kwargs) + return self.tx_rx_all_of_model_endpoint.call_with_http_info(**kwargs) - def tx_rx_all_of_model( + def tx_rx_any_of_model( self, **kwargs ): """tx_rx_any_of_model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True + >>> thread = api.tx_rx_any_of_model(async_req=True) >>> result = thread.get() + + Keyword Args: - stream_options (StreamOptions): [optional] + gm_fruit_no_properties (GmFruitNoProperties): [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -3849,6 +3853,7 @@ def tx_rx_all_of_model( in the spec for a single request. Default is None async_req (bool): execute request asynchronously + Returns: GmFruitNoProperties If the method is called asynchronously, returns the request @@ -3879,7 +3884,7 @@ def tx_rx_all_of_model( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.tx_rx_all_of_model_endpoint.call_with_http_info(**kwargs) + return self.tx_rx_any_of_model_endpoint.call_with_http_info(**kwargs) def upload_download_file( self,