forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 5.2.x
This commit is contained in:
@@ -40,6 +40,7 @@ docs/EnumTest.md
|
||||
docs/EquilateralTriangle.md
|
||||
docs/FakeApi.md
|
||||
docs/FakeClassnameTags123Api.md
|
||||
docs/FakeGetInlineAdditionalPropertiesPayloadArrayData.md
|
||||
docs/File.md
|
||||
docs/FileSchemaTestClass.md
|
||||
docs/Foo.md
|
||||
@@ -50,6 +51,8 @@ docs/GmFruit.md
|
||||
docs/GrandparentAnimal.md
|
||||
docs/HasOnlyReadOnly.md
|
||||
docs/HealthCheckResult.md
|
||||
docs/InlineAdditionalPropertiesRefPayload.md
|
||||
docs/InlineObject6.md
|
||||
docs/InlineResponseDefault.md
|
||||
docs/IntegerEnum.md
|
||||
docs/IntegerEnumOneValue.md
|
||||
@@ -77,12 +80,14 @@ docs/Pig.md
|
||||
docs/Quadrilateral.md
|
||||
docs/QuadrilateralInterface.md
|
||||
docs/ReadOnlyFirst.md
|
||||
docs/Readonly.md
|
||||
docs/ScaleneTriangle.md
|
||||
docs/Shape.md
|
||||
docs/ShapeInterface.md
|
||||
docs/ShapeOrNull.md
|
||||
docs/SimpleQuadrilateral.md
|
||||
docs/SomeObject.md
|
||||
docs/SomeObjectWithSelfAttr.md
|
||||
docs/SpecialModelName.md
|
||||
docs/StoreApi.md
|
||||
docs/StringBooleanMap.md
|
||||
@@ -144,6 +149,7 @@ petstore_api/model/enum_arrays.py
|
||||
petstore_api/model/enum_class.py
|
||||
petstore_api/model/enum_test.py
|
||||
petstore_api/model/equilateral_triangle.py
|
||||
petstore_api/model/fake_get_inline_additional_properties_payload_array_data.py
|
||||
petstore_api/model/file.py
|
||||
petstore_api/model/file_schema_test_class.py
|
||||
petstore_api/model/foo.py
|
||||
@@ -154,6 +160,8 @@ petstore_api/model/gm_fruit.py
|
||||
petstore_api/model/grandparent_animal.py
|
||||
petstore_api/model/has_only_read_only.py
|
||||
petstore_api/model/health_check_result.py
|
||||
petstore_api/model/inline_additional_properties_ref_payload.py
|
||||
petstore_api/model/inline_object6.py
|
||||
petstore_api/model/inline_response_default.py
|
||||
petstore_api/model/integer_enum.py
|
||||
petstore_api/model/integer_enum_one_value.py
|
||||
@@ -180,12 +188,14 @@ petstore_api/model/pig.py
|
||||
petstore_api/model/quadrilateral.py
|
||||
petstore_api/model/quadrilateral_interface.py
|
||||
petstore_api/model/read_only_first.py
|
||||
petstore_api/model/readonly.py
|
||||
petstore_api/model/scalene_triangle.py
|
||||
petstore_api/model/shape.py
|
||||
petstore_api/model/shape_interface.py
|
||||
petstore_api/model/shape_or_null.py
|
||||
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/string_boolean_map.py
|
||||
petstore_api/model/string_enum.py
|
||||
|
||||
@@ -91,6 +91,8 @@ Class | Method | HTTP request | Description
|
||||
*FakeApi* | [**download_attachment**](docs/FakeApi.md#download_attachment) | **GET** /{fileName} | downloads a file using Content-Disposition
|
||||
*FakeApi* | [**enum_test**](docs/FakeApi.md#enum_test) | **POST** /fake/refs/enum-test | Object contains enum properties and array properties containing enums
|
||||
*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**get_inline_additional_properties_payload**](docs/FakeApi.md#get_inline_additional_properties_payload) | **GET** /fake/getInlineAdditionalPropertiesPayload |
|
||||
*FakeApi* | [**get_inline_additional_properties_ref_payload**](docs/FakeApi.md#get_inline_additional_properties_ref_payload) | **GET** /fake/getInlineAdditionalPropertiesRefPayload |
|
||||
*FakeApi* | [**mammal**](docs/FakeApi.md#mammal) | **POST** /fake/refs/mammal |
|
||||
*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
|
||||
*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
|
||||
@@ -166,6 +168,7 @@ Class | Method | HTTP request | Description
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
- [EquilateralTriangle](docs/EquilateralTriangle.md)
|
||||
- [FakeGetInlineAdditionalPropertiesPayloadArrayData](docs/FakeGetInlineAdditionalPropertiesPayloadArrayData.md)
|
||||
- [File](docs/File.md)
|
||||
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [Foo](docs/Foo.md)
|
||||
@@ -176,6 +179,8 @@ Class | Method | HTTP request | Description
|
||||
- [GrandparentAnimal](docs/GrandparentAnimal.md)
|
||||
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [HealthCheckResult](docs/HealthCheckResult.md)
|
||||
- [InlineAdditionalPropertiesRefPayload](docs/InlineAdditionalPropertiesRefPayload.md)
|
||||
- [InlineObject6](docs/InlineObject6.md)
|
||||
- [InlineResponseDefault](docs/InlineResponseDefault.md)
|
||||
- [IntegerEnum](docs/IntegerEnum.md)
|
||||
- [IntegerEnumOneValue](docs/IntegerEnumOneValue.md)
|
||||
@@ -202,12 +207,14 @@ Class | Method | HTTP request | Description
|
||||
- [Quadrilateral](docs/Quadrilateral.md)
|
||||
- [QuadrilateralInterface](docs/QuadrilateralInterface.md)
|
||||
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [Readonly](docs/Readonly.md)
|
||||
- [ScaleneTriangle](docs/ScaleneTriangle.md)
|
||||
- [Shape](docs/Shape.md)
|
||||
- [ShapeInterface](docs/ShapeInterface.md)
|
||||
- [ShapeOrNull](docs/ShapeOrNull.md)
|
||||
- [SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
|
||||
- [SomeObject](docs/SomeObject.md)
|
||||
- [SomeObjectWithSelfAttr](docs/SomeObjectWithSelfAttr.md)
|
||||
- [SpecialModelName](docs/SpecialModelName.md)
|
||||
- [StringBooleanMap](docs/StringBooleanMap.md)
|
||||
- [StringEnum](docs/StringEnum.md)
|
||||
|
||||
@@ -12,6 +12,8 @@ Method | HTTP request | Description
|
||||
[**download_attachment**](FakeApi.md#download_attachment) | **GET** /{fileName} | downloads a file using Content-Disposition
|
||||
[**enum_test**](FakeApi.md#enum_test) | **POST** /fake/refs/enum-test | Object contains enum properties and array properties containing enums
|
||||
[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
|
||||
[**get_inline_additional_properties_payload**](FakeApi.md#get_inline_additional_properties_payload) | **GET** /fake/getInlineAdditionalPropertiesPayload |
|
||||
[**get_inline_additional_properties_ref_payload**](FakeApi.md#get_inline_additional_properties_ref_payload) | **GET** /fake/getInlineAdditionalPropertiesRefPayload |
|
||||
[**mammal**](FakeApi.md#mammal) | **POST** /fake/refs/mammal |
|
||||
[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
|
||||
[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
|
||||
@@ -562,6 +564,148 @@ 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)
|
||||
|
||||
# **get_inline_additional_properties_payload**
|
||||
> InlineObject6 get_inline_additional_properties_payload()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```python
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.api import fake_api
|
||||
from petstore_api.model.inline_object6 import InlineObject6
|
||||
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)
|
||||
inline_object6 = InlineObject6(
|
||||
array_data=[
|
||||
FakeGetInlineAdditionalPropertiesPayloadArrayData(
|
||||
labels=[
|
||||
"labels_example",
|
||||
],
|
||||
),
|
||||
],
|
||||
) # InlineObject6 | (optional)
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
# and optional values
|
||||
try:
|
||||
api_response = api_instance.get_inline_additional_properties_payload(inline_object6=inline_object6)
|
||||
pprint(api_response)
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling FakeApi->get_inline_additional_properties_payload: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**inline_object6** | [**InlineObject6**](InlineObject6.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**InlineObject6**](InlineObject6.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | InlineAdditionalPropertiesPayload | - |
|
||||
|
||||
[[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)
|
||||
|
||||
# **get_inline_additional_properties_ref_payload**
|
||||
> InlineAdditionalPropertiesRefPayload get_inline_additional_properties_ref_payload()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```python
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.api import fake_api
|
||||
from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload
|
||||
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)
|
||||
inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload(
|
||||
array_data=[
|
||||
FakeGetInlineAdditionalPropertiesPayloadArrayData(
|
||||
labels=[
|
||||
"labels_example",
|
||||
],
|
||||
),
|
||||
],
|
||||
) # InlineAdditionalPropertiesRefPayload | (optional)
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
# and optional values
|
||||
try:
|
||||
api_response = api_instance.get_inline_additional_properties_ref_payload(inline_additional_properties_ref_payload=inline_additional_properties_ref_payload)
|
||||
pprint(api_response)
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling FakeApi->get_inline_additional_properties_ref_payload: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**inline_additional_properties_ref_payload** | [**InlineAdditionalPropertiesRefPayload**](InlineAdditionalPropertiesRefPayload.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**InlineAdditionalPropertiesRefPayload**](InlineAdditionalPropertiesRefPayload.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | InlineAdditionalPropertiesRefPayload | - |
|
||||
|
||||
[[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)
|
||||
|
||||
# **mammal**
|
||||
> Mammal mammal(mammal)
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**labels** | **[str, none_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# InlineAdditionalPropertiesRefPayload
|
||||
|
||||
this payload is used for verification that some model_to_dict issues are fixed
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**array_data** | [**[FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type**](FakeGetInlineAdditionalPropertiesPayloadArrayData.md) | | [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)
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# InlineObject6
|
||||
|
||||
this payload is used for verification that some model_to_dict issues are fixed
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**array_data** | [**[FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type**](FakeGetInlineAdditionalPropertiesPayloadArrayData.md) | | [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)
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ a model that includes properties which should stay primitive (String + Boolean)
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional]
|
||||
**my_readonly** | [**Readonly**](Readonly.md) | | [optional]
|
||||
**my_string** | **str** | | [optional]
|
||||
**my_boolean** | **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]
|
||||
|
||||
11
samples/openapi3/client/petstore/python/docs/Readonly.md
Normal file
11
samples/openapi3/client/petstore/python/docs/Readonly.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Readonly
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **str** | | [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)
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# SomeObjectWithSelfAttr
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_self** | **str** | | [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)
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ from petstore_api.model.composed_one_of_number_with_validations import ComposedO
|
||||
from petstore_api.model.enum_test import EnumTest
|
||||
from petstore_api.model.file_schema_test_class import FileSchemaTestClass
|
||||
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
|
||||
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
|
||||
@@ -943,6 +945,228 @@ class FakeApi(object):
|
||||
callable=__fake_health_get
|
||||
)
|
||||
|
||||
def __get_inline_additional_properties_payload(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""get_inline_additional_properties_payload # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.get_inline_additional_properties_payload(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
|
||||
Keyword Args:
|
||||
inline_object6 (InlineObject6): [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 (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.
|
||||
_host_index (int/None): specifies the index of the server
|
||||
that we want to use.
|
||||
Default is read from the configuration.
|
||||
async_req (bool): execute request asynchronously
|
||||
|
||||
Returns:
|
||||
InlineObject6
|
||||
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['_host_index'] = kwargs.get('_host_index')
|
||||
return self.call_with_http_info(**kwargs)
|
||||
|
||||
self.get_inline_additional_properties_payload = _Endpoint(
|
||||
settings={
|
||||
'response_type': (InlineObject6,),
|
||||
'auth': [],
|
||||
'endpoint_path': '/fake/getInlineAdditionalPropertiesPayload',
|
||||
'operation_id': 'get_inline_additional_properties_payload',
|
||||
'http_method': 'GET',
|
||||
'servers': None,
|
||||
},
|
||||
params_map={
|
||||
'all': [
|
||||
'inline_object6',
|
||||
],
|
||||
'required': [],
|
||||
'nullable': [
|
||||
],
|
||||
'enum': [
|
||||
],
|
||||
'validation': [
|
||||
]
|
||||
},
|
||||
root_map={
|
||||
'validations': {
|
||||
},
|
||||
'allowed_values': {
|
||||
},
|
||||
'openapi_types': {
|
||||
'inline_object6':
|
||||
(InlineObject6,),
|
||||
},
|
||||
'attribute_map': {
|
||||
},
|
||||
'location_map': {
|
||||
'inline_object6': 'body',
|
||||
},
|
||||
'collection_format_map': {
|
||||
}
|
||||
},
|
||||
headers_map={
|
||||
'accept': [
|
||||
'application/json'
|
||||
],
|
||||
'content_type': [
|
||||
'application/json'
|
||||
]
|
||||
},
|
||||
api_client=api_client,
|
||||
callable=__get_inline_additional_properties_payload
|
||||
)
|
||||
|
||||
def __get_inline_additional_properties_ref_payload(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""get_inline_additional_properties_ref_payload # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.get_inline_additional_properties_ref_payload(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
|
||||
Keyword Args:
|
||||
inline_additional_properties_ref_payload (InlineAdditionalPropertiesRefPayload): [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 (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.
|
||||
_host_index (int/None): specifies the index of the server
|
||||
that we want to use.
|
||||
Default is read from the configuration.
|
||||
async_req (bool): execute request asynchronously
|
||||
|
||||
Returns:
|
||||
InlineAdditionalPropertiesRefPayload
|
||||
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['_host_index'] = kwargs.get('_host_index')
|
||||
return self.call_with_http_info(**kwargs)
|
||||
|
||||
self.get_inline_additional_properties_ref_payload = _Endpoint(
|
||||
settings={
|
||||
'response_type': (InlineAdditionalPropertiesRefPayload,),
|
||||
'auth': [],
|
||||
'endpoint_path': '/fake/getInlineAdditionalPropertiesRefPayload',
|
||||
'operation_id': 'get_inline_additional_properties_ref_payload',
|
||||
'http_method': 'GET',
|
||||
'servers': None,
|
||||
},
|
||||
params_map={
|
||||
'all': [
|
||||
'inline_additional_properties_ref_payload',
|
||||
],
|
||||
'required': [],
|
||||
'nullable': [
|
||||
],
|
||||
'enum': [
|
||||
],
|
||||
'validation': [
|
||||
]
|
||||
},
|
||||
root_map={
|
||||
'validations': {
|
||||
},
|
||||
'allowed_values': {
|
||||
},
|
||||
'openapi_types': {
|
||||
'inline_additional_properties_ref_payload':
|
||||
(InlineAdditionalPropertiesRefPayload,),
|
||||
},
|
||||
'attribute_map': {
|
||||
},
|
||||
'location_map': {
|
||||
'inline_additional_properties_ref_payload': 'body',
|
||||
},
|
||||
'collection_format_map': {
|
||||
}
|
||||
},
|
||||
headers_map={
|
||||
'accept': [
|
||||
'application/json'
|
||||
],
|
||||
'content_type': [
|
||||
'application/json'
|
||||
]
|
||||
},
|
||||
api_client=api_client,
|
||||
callable=__get_inline_additional_properties_ref_payload
|
||||
)
|
||||
|
||||
def __mammal(
|
||||
self,
|
||||
mammal,
|
||||
@@ -2015,7 +2239,7 @@ class FakeApi(object):
|
||||
},
|
||||
('double',): {
|
||||
|
||||
'inclusive_maximum': 123.4,
|
||||
'exclusive_maximum': 123.4,
|
||||
'inclusive_minimum': 67.8,
|
||||
},
|
||||
('pattern_without_delimiter',): {
|
||||
@@ -2036,7 +2260,7 @@ class FakeApi(object):
|
||||
},
|
||||
('float',): {
|
||||
|
||||
'inclusive_maximum': 987.6,
|
||||
'exclusive_maximum': 987.6,
|
||||
},
|
||||
('string',): {
|
||||
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ApiTypeError,
|
||||
ModelComposed,
|
||||
ModelNormal,
|
||||
ModelSimple,
|
||||
cached_property,
|
||||
change_keys_js_to_python,
|
||||
convert_js_args_to_python_args,
|
||||
date,
|
||||
datetime,
|
||||
file_type,
|
||||
none_type,
|
||||
validate_get_composed_info,
|
||||
)
|
||||
|
||||
|
||||
class FakeGetInlineAdditionalPropertiesPayloadArrayData(ModelNormal):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
|
||||
Attributes:
|
||||
allowed_values (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
with a capitalized key describing the allowed value and an allowed
|
||||
value. These dicts store the allowed enum values.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
discriminator_value_class_map (dict): A dict to go from the discriminator
|
||||
variable value to the discriminator class name.
|
||||
validations (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
that stores validations for max_length, min_length, max_items,
|
||||
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||
inclusive_minimum, and regex.
|
||||
additional_properties_type (tuple): A tuple of classes accepted
|
||||
as additional properties values.
|
||||
"""
|
||||
|
||||
allowed_values = {
|
||||
}
|
||||
|
||||
validations = {
|
||||
}
|
||||
|
||||
additional_properties_type = None
|
||||
|
||||
_nullable = False
|
||||
|
||||
@cached_property
|
||||
def openapi_types():
|
||||
"""
|
||||
This must be a method because a model may have properties that are
|
||||
of type self, this must run after the class is loaded
|
||||
|
||||
Returns
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
"""
|
||||
return {
|
||||
'labels': ([str, none_type],), # noqa: E501
|
||||
}
|
||||
|
||||
@cached_property
|
||||
def discriminator():
|
||||
return None
|
||||
|
||||
|
||||
attribute_map = {
|
||||
'labels': 'labels', # noqa: E501
|
||||
}
|
||||
|
||||
_composed_schemas = {}
|
||||
|
||||
required_properties = set([
|
||||
'_data_store',
|
||||
'_check_type',
|
||||
'_spec_property_naming',
|
||||
'_path_to_item',
|
||||
'_configuration',
|
||||
'_visited_composed_classes',
|
||||
])
|
||||
|
||||
@convert_js_args_to_python_args
|
||||
def __init__(self, *args, **kwargs): # noqa: E501
|
||||
"""FakeGetInlineAdditionalPropertiesPayloadArrayData - a model defined in OpenAPI
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
Defaults to True
|
||||
_path_to_item (tuple/list): This is a list of keys or values to
|
||||
drill down to the model in received_data
|
||||
when deserializing a response
|
||||
_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)
|
||||
_configuration (Configuration): the instance to use when
|
||||
deserializing a file_type parameter.
|
||||
If passed, type conversion is attempted
|
||||
If omitted no type conversion is done.
|
||||
_visited_composed_classes (tuple): This stores a tuple of
|
||||
classes that we have traveled through so that
|
||||
if we see that class again we will not use its
|
||||
discriminator again.
|
||||
When traveling through a discriminator, the
|
||||
composed schema that is
|
||||
is traveled through is added to this set.
|
||||
For example if Animal has a discriminator
|
||||
petType and we pass in "Dog", and the class Dog
|
||||
allOf includes Animal, we move through Animal
|
||||
once using the discriminator, and pick Dog.
|
||||
Then in Dog, we will make an instance of the
|
||||
Animal class but this time we won't travel
|
||||
through its discriminator because we passed in
|
||||
_visited_composed_classes = (Animal,)
|
||||
labels ([str, none_type]): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
||||
_path_to_item = kwargs.pop('_path_to_item', ())
|
||||
_configuration = kwargs.pop('_configuration', None)
|
||||
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
||||
|
||||
if args:
|
||||
raise ApiTypeError(
|
||||
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
||||
args,
|
||||
self.__class__.__name__,
|
||||
),
|
||||
path_to_item=_path_to_item,
|
||||
valid_classes=(self.__class__,),
|
||||
)
|
||||
|
||||
self._data_store = {}
|
||||
self._check_type = _check_type
|
||||
self._spec_property_naming = _spec_property_naming
|
||||
self._path_to_item = _path_to_item
|
||||
self._configuration = _configuration
|
||||
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
||||
|
||||
for var_name, var_value in kwargs.items():
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
@@ -0,0 +1,171 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ApiTypeError,
|
||||
ModelComposed,
|
||||
ModelNormal,
|
||||
ModelSimple,
|
||||
cached_property,
|
||||
change_keys_js_to_python,
|
||||
convert_js_args_to_python_args,
|
||||
date,
|
||||
datetime,
|
||||
file_type,
|
||||
none_type,
|
||||
validate_get_composed_info,
|
||||
)
|
||||
|
||||
def lazy_import():
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakeGetInlineAdditionalPropertiesPayloadArrayData'] = FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
|
||||
|
||||
class InlineAdditionalPropertiesRefPayload(ModelNormal):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
|
||||
Attributes:
|
||||
allowed_values (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
with a capitalized key describing the allowed value and an allowed
|
||||
value. These dicts store the allowed enum values.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
discriminator_value_class_map (dict): A dict to go from the discriminator
|
||||
variable value to the discriminator class name.
|
||||
validations (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
that stores validations for max_length, min_length, max_items,
|
||||
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||
inclusive_minimum, and regex.
|
||||
additional_properties_type (tuple): A tuple of classes accepted
|
||||
as additional properties values.
|
||||
"""
|
||||
|
||||
allowed_values = {
|
||||
}
|
||||
|
||||
validations = {
|
||||
}
|
||||
|
||||
additional_properties_type = None
|
||||
|
||||
_nullable = False
|
||||
|
||||
@cached_property
|
||||
def openapi_types():
|
||||
"""
|
||||
This must be a method because a model may have properties that are
|
||||
of type self, this must run after the class is loaded
|
||||
|
||||
Returns
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
"""
|
||||
lazy_import()
|
||||
return {
|
||||
'array_data': ([FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type,), # noqa: E501
|
||||
}
|
||||
|
||||
@cached_property
|
||||
def discriminator():
|
||||
return None
|
||||
|
||||
|
||||
attribute_map = {
|
||||
'array_data': 'arrayData', # noqa: E501
|
||||
}
|
||||
|
||||
_composed_schemas = {}
|
||||
|
||||
required_properties = set([
|
||||
'_data_store',
|
||||
'_check_type',
|
||||
'_spec_property_naming',
|
||||
'_path_to_item',
|
||||
'_configuration',
|
||||
'_visited_composed_classes',
|
||||
])
|
||||
|
||||
@convert_js_args_to_python_args
|
||||
def __init__(self, *args, **kwargs): # noqa: E501
|
||||
"""InlineAdditionalPropertiesRefPayload - a model defined in OpenAPI
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
Defaults to True
|
||||
_path_to_item (tuple/list): This is a list of keys or values to
|
||||
drill down to the model in received_data
|
||||
when deserializing a response
|
||||
_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)
|
||||
_configuration (Configuration): the instance to use when
|
||||
deserializing a file_type parameter.
|
||||
If passed, type conversion is attempted
|
||||
If omitted no type conversion is done.
|
||||
_visited_composed_classes (tuple): This stores a tuple of
|
||||
classes that we have traveled through so that
|
||||
if we see that class again we will not use its
|
||||
discriminator again.
|
||||
When traveling through a discriminator, the
|
||||
composed schema that is
|
||||
is traveled through is added to this set.
|
||||
For example if Animal has a discriminator
|
||||
petType and we pass in "Dog", and the class Dog
|
||||
allOf includes Animal, we move through Animal
|
||||
once using the discriminator, and pick Dog.
|
||||
Then in Dog, we will make an instance of the
|
||||
Animal class but this time we won't travel
|
||||
through its discriminator because we passed in
|
||||
_visited_composed_classes = (Animal,)
|
||||
array_data ([FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
||||
_path_to_item = kwargs.pop('_path_to_item', ())
|
||||
_configuration = kwargs.pop('_configuration', None)
|
||||
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
||||
|
||||
if args:
|
||||
raise ApiTypeError(
|
||||
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
||||
args,
|
||||
self.__class__.__name__,
|
||||
),
|
||||
path_to_item=_path_to_item,
|
||||
valid_classes=(self.__class__,),
|
||||
)
|
||||
|
||||
self._data_store = {}
|
||||
self._check_type = _check_type
|
||||
self._spec_property_naming = _spec_property_naming
|
||||
self._path_to_item = _path_to_item
|
||||
self._configuration = _configuration
|
||||
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
||||
|
||||
for var_name, var_value in kwargs.items():
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
@@ -0,0 +1,171 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ApiTypeError,
|
||||
ModelComposed,
|
||||
ModelNormal,
|
||||
ModelSimple,
|
||||
cached_property,
|
||||
change_keys_js_to_python,
|
||||
convert_js_args_to_python_args,
|
||||
date,
|
||||
datetime,
|
||||
file_type,
|
||||
none_type,
|
||||
validate_get_composed_info,
|
||||
)
|
||||
|
||||
def lazy_import():
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakeGetInlineAdditionalPropertiesPayloadArrayData'] = FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
|
||||
|
||||
class InlineObject6(ModelNormal):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
|
||||
Attributes:
|
||||
allowed_values (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
with a capitalized key describing the allowed value and an allowed
|
||||
value. These dicts store the allowed enum values.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
discriminator_value_class_map (dict): A dict to go from the discriminator
|
||||
variable value to the discriminator class name.
|
||||
validations (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
that stores validations for max_length, min_length, max_items,
|
||||
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||
inclusive_minimum, and regex.
|
||||
additional_properties_type (tuple): A tuple of classes accepted
|
||||
as additional properties values.
|
||||
"""
|
||||
|
||||
allowed_values = {
|
||||
}
|
||||
|
||||
validations = {
|
||||
}
|
||||
|
||||
additional_properties_type = None
|
||||
|
||||
_nullable = False
|
||||
|
||||
@cached_property
|
||||
def openapi_types():
|
||||
"""
|
||||
This must be a method because a model may have properties that are
|
||||
of type self, this must run after the class is loaded
|
||||
|
||||
Returns
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
"""
|
||||
lazy_import()
|
||||
return {
|
||||
'array_data': ([FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type,), # noqa: E501
|
||||
}
|
||||
|
||||
@cached_property
|
||||
def discriminator():
|
||||
return None
|
||||
|
||||
|
||||
attribute_map = {
|
||||
'array_data': 'arrayData', # noqa: E501
|
||||
}
|
||||
|
||||
_composed_schemas = {}
|
||||
|
||||
required_properties = set([
|
||||
'_data_store',
|
||||
'_check_type',
|
||||
'_spec_property_naming',
|
||||
'_path_to_item',
|
||||
'_configuration',
|
||||
'_visited_composed_classes',
|
||||
])
|
||||
|
||||
@convert_js_args_to_python_args
|
||||
def __init__(self, *args, **kwargs): # noqa: E501
|
||||
"""InlineObject6 - a model defined in OpenAPI
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
Defaults to True
|
||||
_path_to_item (tuple/list): This is a list of keys or values to
|
||||
drill down to the model in received_data
|
||||
when deserializing a response
|
||||
_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)
|
||||
_configuration (Configuration): the instance to use when
|
||||
deserializing a file_type parameter.
|
||||
If passed, type conversion is attempted
|
||||
If omitted no type conversion is done.
|
||||
_visited_composed_classes (tuple): This stores a tuple of
|
||||
classes that we have traveled through so that
|
||||
if we see that class again we will not use its
|
||||
discriminator again.
|
||||
When traveling through a discriminator, the
|
||||
composed schema that is
|
||||
is traveled through is added to this set.
|
||||
For example if Animal has a discriminator
|
||||
petType and we pass in "Dog", and the class Dog
|
||||
allOf includes Animal, we move through Animal
|
||||
once using the discriminator, and pick Dog.
|
||||
Then in Dog, we will make an instance of the
|
||||
Animal class but this time we won't travel
|
||||
through its discriminator because we passed in
|
||||
_visited_composed_classes = (Animal,)
|
||||
array_data ([FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
||||
_path_to_item = kwargs.pop('_path_to_item', ())
|
||||
_configuration = kwargs.pop('_configuration', None)
|
||||
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
||||
|
||||
if args:
|
||||
raise ApiTypeError(
|
||||
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
||||
args,
|
||||
self.__class__.__name__,
|
||||
),
|
||||
path_to_item=_path_to_item,
|
||||
valid_classes=(self.__class__,),
|
||||
)
|
||||
|
||||
self._data_store = {}
|
||||
self._check_type = _check_type
|
||||
self._spec_property_naming = _spec_property_naming
|
||||
self._path_to_item = _path_to_item
|
||||
self._configuration = _configuration
|
||||
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
||||
|
||||
for var_name, var_value in kwargs.items():
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
@@ -28,7 +28,9 @@ from petstore_api.model_utils import ( # noqa: F401
|
||||
|
||||
def lazy_import():
|
||||
from petstore_api.model.number_with_validations import NumberWithValidations
|
||||
from petstore_api.model.readonly import Readonly
|
||||
globals()['NumberWithValidations'] = NumberWithValidations
|
||||
globals()['Readonly'] = Readonly
|
||||
|
||||
|
||||
class ObjectModelWithRefProps(ModelNormal):
|
||||
@@ -85,6 +87,7 @@ class ObjectModelWithRefProps(ModelNormal):
|
||||
lazy_import()
|
||||
return {
|
||||
'my_number': (NumberWithValidations,), # noqa: E501
|
||||
'my_readonly': (Readonly,), # noqa: E501
|
||||
'my_string': (str,), # noqa: E501
|
||||
'my_boolean': (bool,), # noqa: E501
|
||||
}
|
||||
@@ -96,6 +99,7 @@ class ObjectModelWithRefProps(ModelNormal):
|
||||
|
||||
attribute_map = {
|
||||
'my_number': 'my_number', # noqa: E501
|
||||
'my_readonly': 'my_readonly', # noqa: E501
|
||||
'my_string': 'my_string', # noqa: E501
|
||||
'my_boolean': 'my_boolean', # noqa: E501
|
||||
}
|
||||
@@ -147,6 +151,7 @@ class ObjectModelWithRefProps(ModelNormal):
|
||||
through its discriminator because we passed in
|
||||
_visited_composed_classes = (Animal,)
|
||||
my_number (NumberWithValidations): [optional] # noqa: E501
|
||||
my_readonly (Readonly): [optional] # noqa: E501
|
||||
my_string (str): [optional] # noqa: E501
|
||||
my_boolean (bool): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ApiTypeError,
|
||||
ModelComposed,
|
||||
ModelNormal,
|
||||
ModelSimple,
|
||||
cached_property,
|
||||
change_keys_js_to_python,
|
||||
convert_js_args_to_python_args,
|
||||
date,
|
||||
datetime,
|
||||
file_type,
|
||||
none_type,
|
||||
validate_get_composed_info,
|
||||
)
|
||||
|
||||
|
||||
class Readonly(ModelNormal):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
|
||||
Attributes:
|
||||
allowed_values (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
with a capitalized key describing the allowed value and an allowed
|
||||
value. These dicts store the allowed enum values.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
discriminator_value_class_map (dict): A dict to go from the discriminator
|
||||
variable value to the discriminator class name.
|
||||
validations (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
that stores validations for max_length, min_length, max_items,
|
||||
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||
inclusive_minimum, and regex.
|
||||
additional_properties_type (tuple): A tuple of classes accepted
|
||||
as additional properties values.
|
||||
"""
|
||||
|
||||
allowed_values = {
|
||||
}
|
||||
|
||||
validations = {
|
||||
}
|
||||
|
||||
additional_properties_type = None
|
||||
|
||||
_nullable = False
|
||||
|
||||
@cached_property
|
||||
def openapi_types():
|
||||
"""
|
||||
This must be a method because a model may have properties that are
|
||||
of type self, this must run after the class is loaded
|
||||
|
||||
Returns
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
"""
|
||||
return {
|
||||
'name': (str,), # noqa: E501
|
||||
}
|
||||
|
||||
@cached_property
|
||||
def discriminator():
|
||||
return None
|
||||
|
||||
|
||||
attribute_map = {
|
||||
'name': 'name', # noqa: E501
|
||||
}
|
||||
|
||||
_composed_schemas = {}
|
||||
|
||||
required_properties = set([
|
||||
'_data_store',
|
||||
'_check_type',
|
||||
'_spec_property_naming',
|
||||
'_path_to_item',
|
||||
'_configuration',
|
||||
'_visited_composed_classes',
|
||||
])
|
||||
|
||||
@convert_js_args_to_python_args
|
||||
def __init__(self, *args, **kwargs): # noqa: E501
|
||||
"""Readonly - a model defined in OpenAPI
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
Defaults to True
|
||||
_path_to_item (tuple/list): This is a list of keys or values to
|
||||
drill down to the model in received_data
|
||||
when deserializing a response
|
||||
_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)
|
||||
_configuration (Configuration): the instance to use when
|
||||
deserializing a file_type parameter.
|
||||
If passed, type conversion is attempted
|
||||
If omitted no type conversion is done.
|
||||
_visited_composed_classes (tuple): This stores a tuple of
|
||||
classes that we have traveled through so that
|
||||
if we see that class again we will not use its
|
||||
discriminator again.
|
||||
When traveling through a discriminator, the
|
||||
composed schema that is
|
||||
is traveled through is added to this set.
|
||||
For example if Animal has a discriminator
|
||||
petType and we pass in "Dog", and the class Dog
|
||||
allOf includes Animal, we move through Animal
|
||||
once using the discriminator, and pick Dog.
|
||||
Then in Dog, we will make an instance of the
|
||||
Animal class but this time we won't travel
|
||||
through its discriminator because we passed in
|
||||
_visited_composed_classes = (Animal,)
|
||||
name (str): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
||||
_path_to_item = kwargs.pop('_path_to_item', ())
|
||||
_configuration = kwargs.pop('_configuration', None)
|
||||
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
||||
|
||||
if args:
|
||||
raise ApiTypeError(
|
||||
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
||||
args,
|
||||
self.__class__.__name__,
|
||||
),
|
||||
path_to_item=_path_to_item,
|
||||
valid_classes=(self.__class__,),
|
||||
)
|
||||
|
||||
self._data_store = {}
|
||||
self._check_type = _check_type
|
||||
self._spec_property_naming = _spec_property_naming
|
||||
self._path_to_item = _path_to_item
|
||||
self._configuration = _configuration
|
||||
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
||||
|
||||
for var_name, var_value in kwargs.items():
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
@@ -0,0 +1,166 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import re # noqa: F401
|
||||
import sys # noqa: F401
|
||||
|
||||
from petstore_api.model_utils import ( # noqa: F401
|
||||
ApiTypeError,
|
||||
ModelComposed,
|
||||
ModelNormal,
|
||||
ModelSimple,
|
||||
cached_property,
|
||||
change_keys_js_to_python,
|
||||
convert_js_args_to_python_args,
|
||||
date,
|
||||
datetime,
|
||||
file_type,
|
||||
none_type,
|
||||
validate_get_composed_info,
|
||||
)
|
||||
|
||||
|
||||
class SomeObjectWithSelfAttr(ModelNormal):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
Do not edit the class manually.
|
||||
|
||||
Attributes:
|
||||
allowed_values (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
with a capitalized key describing the allowed value and an allowed
|
||||
value. These dicts store the allowed enum values.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
discriminator_value_class_map (dict): A dict to go from the discriminator
|
||||
variable value to the discriminator class name.
|
||||
validations (dict): The key is the tuple path to the attribute
|
||||
and the for var_name this is (var_name,). The value is a dict
|
||||
that stores validations for max_length, min_length, max_items,
|
||||
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
||||
inclusive_minimum, and regex.
|
||||
additional_properties_type (tuple): A tuple of classes accepted
|
||||
as additional properties values.
|
||||
"""
|
||||
|
||||
allowed_values = {
|
||||
}
|
||||
|
||||
validations = {
|
||||
}
|
||||
|
||||
additional_properties_type = None
|
||||
|
||||
_nullable = False
|
||||
|
||||
@cached_property
|
||||
def openapi_types():
|
||||
"""
|
||||
This must be a method because a model may have properties that are
|
||||
of type self, this must run after the class is loaded
|
||||
|
||||
Returns
|
||||
openapi_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
"""
|
||||
return {
|
||||
'_self': (str,), # noqa: E501
|
||||
}
|
||||
|
||||
@cached_property
|
||||
def discriminator():
|
||||
return None
|
||||
|
||||
|
||||
attribute_map = {
|
||||
'_self': 'self', # noqa: E501
|
||||
}
|
||||
|
||||
_composed_schemas = {}
|
||||
|
||||
required_properties = set([
|
||||
'_data_store',
|
||||
'_check_type',
|
||||
'_spec_property_naming',
|
||||
'_path_to_item',
|
||||
'_configuration',
|
||||
'_visited_composed_classes',
|
||||
])
|
||||
|
||||
@convert_js_args_to_python_args
|
||||
def __init__(self, *args, **kwargs): # noqa: E501
|
||||
"""SomeObjectWithSelfAttr - a model defined in OpenAPI
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
will be type checked and a TypeError will be
|
||||
raised if the wrong type is input.
|
||||
Defaults to True
|
||||
_path_to_item (tuple/list): This is a list of keys or values to
|
||||
drill down to the model in received_data
|
||||
when deserializing a response
|
||||
_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)
|
||||
_configuration (Configuration): the instance to use when
|
||||
deserializing a file_type parameter.
|
||||
If passed, type conversion is attempted
|
||||
If omitted no type conversion is done.
|
||||
_visited_composed_classes (tuple): This stores a tuple of
|
||||
classes that we have traveled through so that
|
||||
if we see that class again we will not use its
|
||||
discriminator again.
|
||||
When traveling through a discriminator, the
|
||||
composed schema that is
|
||||
is traveled through is added to this set.
|
||||
For example if Animal has a discriminator
|
||||
petType and we pass in "Dog", and the class Dog
|
||||
allOf includes Animal, we move through Animal
|
||||
once using the discriminator, and pick Dog.
|
||||
Then in Dog, we will make an instance of the
|
||||
Animal class but this time we won't travel
|
||||
through its discriminator because we passed in
|
||||
_visited_composed_classes = (Animal,)
|
||||
_self (str): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
||||
_path_to_item = kwargs.pop('_path_to_item', ())
|
||||
_configuration = kwargs.pop('_configuration', None)
|
||||
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
||||
|
||||
if args:
|
||||
raise ApiTypeError(
|
||||
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
||||
args,
|
||||
self.__class__.__name__,
|
||||
),
|
||||
path_to_item=_path_to_item,
|
||||
valid_classes=(self.__class__,),
|
||||
)
|
||||
|
||||
self._data_store = {}
|
||||
self._check_type = _check_type
|
||||
self._spec_property_naming = _spec_property_naming
|
||||
self._path_to_item = _path_to_item
|
||||
self._configuration = _configuration
|
||||
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
||||
|
||||
for var_name, var_value in kwargs.items():
|
||||
if var_name not in self.attribute_map and \
|
||||
self._configuration is not None and \
|
||||
self._configuration.discard_unknown_keys and \
|
||||
self.additional_properties_type is None:
|
||||
# discard variable.
|
||||
continue
|
||||
setattr(self, var_name, var_value)
|
||||
@@ -1508,13 +1508,19 @@ def model_to_dict(model_instance, serialize=True):
|
||||
# exist in attribute_map
|
||||
attr = model_instance.attribute_map.get(attr, attr)
|
||||
if isinstance(value, list):
|
||||
if not value or isinstance(value[0], PRIMITIVE_TYPES):
|
||||
# empty list or primitive types
|
||||
result[attr] = value
|
||||
elif isinstance(value[0], ModelSimple):
|
||||
result[attr] = [x.value for x in value]
|
||||
else:
|
||||
result[attr] = [model_to_dict(x, serialize=serialize) for x in value]
|
||||
if not value:
|
||||
# empty list or None
|
||||
result[attr] = value
|
||||
else:
|
||||
res = []
|
||||
for v in value:
|
||||
if isinstance(v, PRIMITIVE_TYPES) or v is None:
|
||||
res.append(v)
|
||||
elif isinstance(v, ModelSimple):
|
||||
res.append(v.value)
|
||||
else:
|
||||
res.append(model_to_dict(v, serialize=serialize))
|
||||
result[attr] = res
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0],
|
||||
@@ -1574,11 +1580,16 @@ def get_valid_classes_phrase(input_classes):
|
||||
def convert_js_args_to_python_args(fn):
|
||||
from functools import wraps
|
||||
@wraps(fn)
|
||||
def wrapped_init(self, *args, **kwargs):
|
||||
def wrapped_init(_self, *args, **kwargs):
|
||||
"""
|
||||
An attribute named `self` received from the api will conflicts with the reserved `self`
|
||||
parameter of a class method. During generation, `self` attributes are mapped
|
||||
to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts.
|
||||
"""
|
||||
spec_property_naming = kwargs.get('_spec_property_naming', False)
|
||||
if spec_property_naming:
|
||||
kwargs = change_keys_js_to_python(kwargs, self.__class__)
|
||||
return fn(self, *args, **kwargs)
|
||||
kwargs = change_keys_js_to_python(kwargs, _self.__class__)
|
||||
return fn(_self, *args, **kwargs)
|
||||
return wrapped_init
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ from petstore_api.model.enum_arrays import EnumArrays
|
||||
from petstore_api.model.enum_class import EnumClass
|
||||
from petstore_api.model.enum_test import EnumTest
|
||||
from petstore_api.model.equilateral_triangle import EquilateralTriangle
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.file import File
|
||||
from petstore_api.model.file_schema_test_class import FileSchemaTestClass
|
||||
from petstore_api.model.foo import Foo
|
||||
@@ -53,6 +54,8 @@ from petstore_api.model.gm_fruit import GmFruit
|
||||
from petstore_api.model.grandparent_animal import GrandparentAnimal
|
||||
from petstore_api.model.has_only_read_only import HasOnlyReadOnly
|
||||
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
|
||||
from petstore_api.model.inline_response_default import InlineResponseDefault
|
||||
from petstore_api.model.integer_enum import IntegerEnum
|
||||
from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue
|
||||
@@ -79,12 +82,14 @@ from petstore_api.model.pig import Pig
|
||||
from petstore_api.model.quadrilateral import Quadrilateral
|
||||
from petstore_api.model.quadrilateral_interface import QuadrilateralInterface
|
||||
from petstore_api.model.read_only_first import ReadOnlyFirst
|
||||
from petstore_api.model.readonly import Readonly
|
||||
from petstore_api.model.scalene_triangle import ScaleneTriangle
|
||||
from petstore_api.model.shape import Shape
|
||||
from petstore_api.model.shape_interface import ShapeInterface
|
||||
from petstore_api.model.shape_or_null import ShapeOrNull
|
||||
from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral
|
||||
from petstore_api.model.some_object import SomeObject
|
||||
from petstore_api.model.some_object_with_self_attr import SomeObjectWithSelfAttr
|
||||
from petstore_api.model.special_model_name import SpecialModelName
|
||||
from petstore_api.model.string_boolean_map import StringBooleanMap
|
||||
from petstore_api.model.string_enum import StringEnum
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
@@ -57,6 +55,20 @@ class TestFakeApi(unittest.TestCase):
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_download_attachment(self):
|
||||
"""Test case for download_attachment
|
||||
|
||||
downloads a file using Content-Disposition # noqa: E501
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_enum_test(self):
|
||||
"""Test case for enum_test
|
||||
|
||||
Object contains enum properties and array properties containing enums # noqa: E501
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_fake_health_get(self):
|
||||
"""Test case for fake_health_get
|
||||
|
||||
@@ -64,6 +76,18 @@ class TestFakeApi(unittest.TestCase):
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_get_inline_additionl_properties_ref_payload(self):
|
||||
"""Test case for get_inline_additionl_properties_ref_payload
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_mammal(self):
|
||||
"""Test case for mammal
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_number_with_validations(self):
|
||||
"""Test case for number_with_validations
|
||||
|
||||
@@ -148,6 +172,27 @@ class TestFakeApi(unittest.TestCase):
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_upload_download_file(self):
|
||||
"""Test case for upload_download_file
|
||||
|
||||
uploads a file and downloads a file using application/octet-stream # noqa: E501
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_upload_file(self):
|
||||
"""Test case for upload_file
|
||||
|
||||
uploads a file using multipart/form-data # noqa: E501
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_upload_files(self):
|
||||
"""Test case for upload_files
|
||||
|
||||
uploads files using multipart/form-data # noqa: E501
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
|
||||
|
||||
class TestFakeGetInlineAdditionalPropertiesPayloadArrayData(unittest.TestCase):
|
||||
"""FakeGetInlineAdditionalPropertiesPayloadArrayData unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def testFakeGetInlineAdditionalPropertiesPayloadArrayData(self):
|
||||
"""Test FakeGetInlineAdditionalPropertiesPayloadArrayData"""
|
||||
# FIXME: construct object with mandatory attributes with example values
|
||||
# model = FakeGetInlineAdditionalPropertiesPayloadArrayData() # noqa: E501
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakeGetInlineAdditionalPropertiesPayloadArrayData'] = FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload
|
||||
|
||||
|
||||
class TestInlineAdditionalPropertiesRefPayload(unittest.TestCase):
|
||||
"""InlineAdditionalPropertiesRefPayload unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def testInlineAdditionalPropertiesRefPayload(self):
|
||||
"""Test InlineAdditionalPropertiesRefPayload"""
|
||||
# FIXME: construct object with mandatory attributes with example values
|
||||
# model = InlineAdditionalPropertiesRefPayload() # noqa: E501
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakeGetInlineAdditionalPropertiesPayloadArrayData'] = FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.inline_object6 import InlineObject6
|
||||
|
||||
|
||||
class TestInlineObject6(unittest.TestCase):
|
||||
"""InlineObject6 unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def testInlineObject6(self):
|
||||
"""Test InlineObject6"""
|
||||
# FIXME: construct object with mandatory attributes with example values
|
||||
# model = InlineObject6() # noqa: E501
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,35 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.model.readonly import Readonly
|
||||
|
||||
|
||||
class TestReadonly(unittest.TestCase):
|
||||
"""Readonly unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def testReadonly(self):
|
||||
"""Test Readonly"""
|
||||
# FIXME: construct object with mandatory attributes with example values
|
||||
# model = Readonly() # noqa: E501
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,35 @@
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.model.some_object_with_self_attr import SomeObjectWithSelfAttr
|
||||
|
||||
|
||||
class TestSomeObjectWithSelfAttr(unittest.TestCase):
|
||||
"""SomeObjectWithSelfAttr unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def testSomeObjectWithSelfAttr(self):
|
||||
"""Test SomeObjectWithSelfAttr"""
|
||||
kwargs = {"self": "this is a string", "_spec_property_naming": True}
|
||||
model = SomeObjectWithSelfAttr(**kwargs)
|
||||
assert model._self == "this is a string"
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -604,6 +604,75 @@ class TestFakeApi(unittest.TestCase):
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_get_inline_additional_properties_ref_payload(self):
|
||||
"""Test case for getInlineAdditionlPropertiesRefPayload
|
||||
"""
|
||||
from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
endpoint = self.api.get_inline_additional_properties_ref_payload
|
||||
assert endpoint.openapi_types['inline_additional_properties_ref_payload'] == (InlineAdditionalPropertiesRefPayload,)
|
||||
assert endpoint.settings['response_type'] == (InlineAdditionalPropertiesRefPayload,)
|
||||
|
||||
# serialization + deserialization works
|
||||
from petstore_api.rest import RESTClientObject, RESTResponse
|
||||
with patch.object(RESTClientObject, 'request') as mock_method:
|
||||
expected_json_body = {
|
||||
'array_data': [
|
||||
{
|
||||
'labels': [
|
||||
None,
|
||||
'foo'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload(
|
||||
array_data=[
|
||||
FakeGetInlineAdditionalPropertiesPayloadArrayData(labels=[None, 'foo'])
|
||||
]
|
||||
)
|
||||
mock_method.return_value = self.mock_response(expected_json_body)
|
||||
|
||||
response = endpoint(inline_additional_properties_ref_payload=inline_additional_properties_ref_payload)
|
||||
self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/enum', body=expected_json_body)
|
||||
|
||||
assert isinstance(response, InlineAdditionalPropertiesRefPayload)
|
||||
assert response.to_dict() == expected_json_body
|
||||
|
||||
def test_get_inline_additional_properties_payload(self):
|
||||
"""Test case for getInlineAdditionlPropertiesPayload
|
||||
"""
|
||||
from petstore_api.model.inline_object6 import InlineObject6
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
endpoint = self.api.get_inline_additional_properties_payload
|
||||
assert endpoint.openapi_types['inline_object6'] == (InlineObject6,)
|
||||
assert endpoint.settings['response_type'] == (InlineObject6,)
|
||||
|
||||
# serialization + deserialization works
|
||||
from petstore_api.rest import RESTClientObject, RESTResponse
|
||||
with patch.object(RESTClientObject, 'request') as mock_method:
|
||||
expected_json_body = {
|
||||
'array_data': [
|
||||
{
|
||||
'labels': [
|
||||
None,
|
||||
'foo'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
inline_object6 = InlineObject6(
|
||||
array_data=[
|
||||
FakeGetInlineAdditionalPropertiesPayloadArrayData(labels=[None, 'foo'])
|
||||
]
|
||||
)
|
||||
mock_method.return_value = self.mock_response(expected_json_body)
|
||||
|
||||
response = endpoint(inline_object6=inline_object6)
|
||||
self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/enum', body=expected_json_body)
|
||||
|
||||
assert isinstance(response, InlineObject6)
|
||||
assert response.to_dict() == expected_json_body
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -20,6 +20,7 @@ except ImportError:
|
||||
number_with_validations = sys.modules[
|
||||
'petstore_api.model.number_with_validations']
|
||||
from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
|
||||
from petstore_api.model.readonly import Readonly
|
||||
|
||||
|
||||
class TestObjectModelWithRefProps(unittest.TestCase):
|
||||
@@ -38,6 +39,7 @@ class TestObjectModelWithRefProps(unittest.TestCase):
|
||||
ObjectModelWithRefProps.openapi_types,
|
||||
{
|
||||
'my_number': (NumberWithValidations,),
|
||||
'my_readonly': (Readonly,),
|
||||
'my_string': (str,),
|
||||
'my_boolean': (bool,),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user