Skip to content

Commit

Permalink
[get_item_all_of_bug]
Browse files Browse the repository at this point in the history
Added samples, test cases to validate all_of schema.
  • Loading branch information
the-akhil-nair committed Apr 22, 2022
1 parent b8c5458 commit a58caae
Show file tree
Hide file tree
Showing 20 changed files with 1,535 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2503,4 +2503,32 @@ components:
items:
type: object
prop2:
type: object
type: object
StreamOptions:
allOf:
- $ref: "#/components/schemas/EgressThresholdOptions"
- $ref: "#/components/schemas/PublishOptions"

EgressThresholdOptions:
type: object
properties:
egressThresholds:
type: object
additionalProperties:
type: number
minimum: 0
maximum: 1
example: 0.9

PublishOptions:
type: object
properties:
publish:
type : object
properties:
egressUnknownDetections:
type: boolean
example: true
filterZeroDetections:
type: boolean
example: true
12 changes: 12 additions & 0 deletions samples/openapi3/client/petstore/python/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ docs/DefaultApi.md
docs/Dog.md
docs/DogAllOf.md
docs/Drawing.md
docs/EgressThresholdOptions.md
docs/EnumArrays.md
docs/EnumClass.md
docs/EnumTest.md
Expand Down Expand Up @@ -82,6 +83,8 @@ docs/ParentPet.md
docs/Pet.md
docs/PetApi.md
docs/Pig.md
docs/PublishOptions.md
docs/PublishOptionsPublish.md
docs/Quadrilateral.md
docs/QuadrilateralInterface.md
docs/ReadOnlyFirst.md
Expand All @@ -95,6 +98,7 @@ docs/SomeObject.md
docs/SomeObjectWithSelfAttr.md
docs/SpecialModelName.md
docs/StoreApi.md
docs/StreamOptions.md
docs/StringBooleanMap.md
docs/StringEnum.md
docs/StringEnumWithDefaultValue.md
Expand Down Expand Up @@ -151,6 +155,7 @@ petstore_api/model/danish_pig.py
petstore_api/model/dog.py
petstore_api/model/dog_all_of.py
petstore_api/model/drawing.py
petstore_api/model/egress_threshold_options.py
petstore_api/model/enum_arrays.py
petstore_api/model/enum_class.py
petstore_api/model/enum_test.py
Expand Down Expand Up @@ -195,6 +200,8 @@ petstore_api/model/order.py
petstore_api/model/parent_pet.py
petstore_api/model/pet.py
petstore_api/model/pig.py
petstore_api/model/publish_options.py
petstore_api/model/publish_options_publish.py
petstore_api/model/quadrilateral.py
petstore_api/model/quadrilateral_interface.py
petstore_api/model/read_only_first.py
Expand All @@ -207,6 +214,7 @@ petstore_api/model/simple_quadrilateral.py
petstore_api/model/some_object.py
petstore_api/model/some_object_with_self_attr.py
petstore_api/model/special_model_name.py
petstore_api/model/stream_options.py
petstore_api/model/string_boolean_map.py
petstore_api/model/string_enum.py
petstore_api/model/string_enum_with_default_value.py
Expand All @@ -225,4 +233,8 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_egress_threshold_options.py
test/test_publish_options.py
test/test_publish_options_publish.py
test/test_stream_options.py
tox.ini
4 changes: 4 additions & 0 deletions samples/openapi3/client/petstore/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ Class | Method | HTTP request | Description
- [Dog](docs/Dog.md)
- [DogAllOf](docs/DogAllOf.md)
- [Drawing](docs/Drawing.md)
- [EgressThresholdOptions](docs/EgressThresholdOptions.md)
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
Expand Down Expand Up @@ -210,6 +211,8 @@ Class | Method | HTTP request | Description
- [ParentPet](docs/ParentPet.md)
- [Pet](docs/Pet.md)
- [Pig](docs/Pig.md)
- [PublishOptions](docs/PublishOptions.md)
- [PublishOptionsPublish](docs/PublishOptionsPublish.md)
- [Quadrilateral](docs/Quadrilateral.md)
- [QuadrilateralInterface](docs/QuadrilateralInterface.md)
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
Expand All @@ -222,6 +225,7 @@ Class | Method | HTTP request | Description
- [SomeObject](docs/SomeObject.md)
- [SomeObjectWithSelfAttr](docs/SomeObjectWithSelfAttr.md)
- [SpecialModelName](docs/SpecialModelName.md)
- [StreamOptions](docs/StreamOptions.md)
- [StringBooleanMap](docs/StringBooleanMap.md)
- [StringEnum](docs/StringEnum.md)
- [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EgressThresholdOptions


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**egress_thresholds** | **{str: (float,)}** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions samples/openapi3/client/petstore/python/docs/PublishOptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# PublishOptions


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**publish** | [**PublishOptionsPublish**](PublishOptionsPublish.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# PublishOptionsPublish


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**egress_unknown_detections** | **bool** | | [optional]
**filter_zero_detections** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


13 changes: 13 additions & 0 deletions samples/openapi3/client/petstore/python/docs/StreamOptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# StreamOptions


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**egress_thresholds** | **{str: (float,)}** | | [optional]
**publish** | [**PublishOptionsPublish**](PublishOptionsPublish.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


122 changes: 122 additions & 0 deletions samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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.inline_object6 import InlineObject6
Expand Down Expand Up @@ -1533,6 +1534,54 @@ def __init__(self, api_client=None):
},
api_client=api_client
)
self.tx_rx_all_of_model_endpoint = _Endpoint(
settings={
'response_type': (StreamOptions,),
'auth': [],
'endpoint_path': '/fake/TxRxAllOfModel',
'operation_id': 'tx_rx_all_of_model',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'stream_options',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'stream_options':
(StreamOptions,),
},
'attribute_map': {
},
'location_map': {
'stream_options': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client
)
self.upload_download_file_endpoint = _Endpoint(
settings={
'response_type': (file_type,),
Expand Down Expand Up @@ -3759,6 +3808,79 @@ def tx_rx_any_of_model(
kwargs['_request_auths'] = kwargs.get('_request_auths', None)
return self.tx_rx_any_of_model_endpoint.call_with_http_info(**kwargs)

def tx_rx_all_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]
_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
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): 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.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
_request_auths (list): set to override the auth_settings for an a single
request; this effectively ignores the authentication
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
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_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)

def upload_download_file(
self,
body,
Expand Down
Loading

0 comments on commit a58caae

Please sign in to comment.