forked from loafle/openapi-generator-original
Fixes python test_fake_api tests (#9483)
* Fixes test_upload_download_file * Fixes test_string * Fixes test_string_enum * Fixes test_number_with_validations test_composed_one_of_number_with_validations * Fixes two more tests * Fixes test_array_of_enums * Fixes two tests * Removes comment * Fixes serializationf of composed schema object models, fixes test * Samples regenerated * Removes pdb
This commit is contained in:
@@ -1335,12 +1335,20 @@ def model_to_dict(model_instance, serialize=True):
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas:
|
||||
model_instances.extend(model_instance._composed_instances)
|
||||
seen_json_attribute_names = set()
|
||||
used_fallback_python_attribute_names = set()
|
||||
py_to_json_map = {}
|
||||
for model_instance in model_instances:
|
||||
for attr, value in model_instance._data_store.items():
|
||||
if serialize:
|
||||
# we use get here because additional property key names do not
|
||||
# exist in attribute_map
|
||||
attr = model_instance.attribute_map.get(attr, attr)
|
||||
try:
|
||||
attr = model_instance.attribute_map[attr]
|
||||
py_to_json_map.update(model_instance.attribute_map)
|
||||
seen_json_attribute_names.add(attr)
|
||||
except KeyError:
|
||||
used_fallback_python_attribute_names.add(attr)
|
||||
if isinstance(value, list):
|
||||
if not value:
|
||||
# empty list or None
|
||||
@@ -1368,6 +1376,16 @@ def model_to_dict(model_instance, serialize=True):
|
||||
result[attr] = model_to_dict(value, serialize=serialize)
|
||||
else:
|
||||
result[attr] = value
|
||||
if serialize:
|
||||
for python_key in used_fallback_python_attribute_names:
|
||||
json_key = py_to_json_map.get(python_key)
|
||||
if json_key is None:
|
||||
continue
|
||||
if python_key == json_key:
|
||||
continue
|
||||
json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names
|
||||
if json_key_assigned_no_need_for_python_key:
|
||||
del result[python_key]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@@ -1288,11 +1288,11 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/HealthCheckResult'
|
||||
/fake/getInlineAdditionalPropertiesRefPayload:
|
||||
get:
|
||||
/fake/postInlineAdditionalPropertiesRefPayload:
|
||||
post:
|
||||
tags:
|
||||
- fake
|
||||
operationId: getInlineAdditionalPropertiesRefPayload
|
||||
operationId: postInlineAdditionalPropertiesRefPayload
|
||||
responses:
|
||||
200:
|
||||
description: InlineAdditionalPropertiesRefPayload
|
||||
@@ -1305,11 +1305,11 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InlineAdditionalPropertiesRefPayload'
|
||||
/fake/getInlineAdditionalPropertiesPayload:
|
||||
get:
|
||||
/fake/postInlineAdditionalPropertiesPayload:
|
||||
post:
|
||||
tags:
|
||||
- fake
|
||||
operationId: getInlineAdditionalPropertiesPayload
|
||||
operationId: postInlineAdditionalPropertiesPayload
|
||||
responses:
|
||||
200:
|
||||
description: InlineAdditionalPropertiesPayload
|
||||
|
||||
@@ -1632,12 +1632,20 @@ def model_to_dict(model_instance, serialize=True):
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas:
|
||||
model_instances.extend(model_instance._composed_instances)
|
||||
seen_json_attribute_names = set()
|
||||
used_fallback_python_attribute_names = set()
|
||||
py_to_json_map = {}
|
||||
for model_instance in model_instances:
|
||||
for attr, value in model_instance._data_store.items():
|
||||
if serialize:
|
||||
# we use get here because additional property key names do not
|
||||
# exist in attribute_map
|
||||
attr = model_instance.attribute_map.get(attr, attr)
|
||||
try:
|
||||
attr = model_instance.attribute_map[attr]
|
||||
py_to_json_map.update(model_instance.attribute_map)
|
||||
seen_json_attribute_names.add(attr)
|
||||
except KeyError:
|
||||
used_fallback_python_attribute_names.add(attr)
|
||||
if isinstance(value, list):
|
||||
if not value:
|
||||
# empty list or None
|
||||
@@ -1665,6 +1673,16 @@ def model_to_dict(model_instance, serialize=True):
|
||||
result[attr] = model_to_dict(value, serialize=serialize)
|
||||
else:
|
||||
result[attr] = value
|
||||
if serialize:
|
||||
for python_key in used_fallback_python_attribute_names:
|
||||
json_key = py_to_json_map.get(python_key)
|
||||
if json_key is None:
|
||||
continue
|
||||
if python_key == json_key:
|
||||
continue
|
||||
json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names
|
||||
if json_key_assigned_no_need_for_python_key:
|
||||
del result[python_key]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@@ -1632,12 +1632,20 @@ def model_to_dict(model_instance, serialize=True):
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas:
|
||||
model_instances.extend(model_instance._composed_instances)
|
||||
seen_json_attribute_names = set()
|
||||
used_fallback_python_attribute_names = set()
|
||||
py_to_json_map = {}
|
||||
for model_instance in model_instances:
|
||||
for attr, value in model_instance._data_store.items():
|
||||
if serialize:
|
||||
# we use get here because additional property key names do not
|
||||
# exist in attribute_map
|
||||
attr = model_instance.attribute_map.get(attr, attr)
|
||||
try:
|
||||
attr = model_instance.attribute_map[attr]
|
||||
py_to_json_map.update(model_instance.attribute_map)
|
||||
seen_json_attribute_names.add(attr)
|
||||
except KeyError:
|
||||
used_fallback_python_attribute_names.add(attr)
|
||||
if isinstance(value, list):
|
||||
if not value:
|
||||
# empty list or None
|
||||
@@ -1665,6 +1673,16 @@ def model_to_dict(model_instance, serialize=True):
|
||||
result[attr] = model_to_dict(value, serialize=serialize)
|
||||
else:
|
||||
result[attr] = value
|
||||
if serialize:
|
||||
for python_key in used_fallback_python_attribute_names:
|
||||
json_key = py_to_json_map.get(python_key)
|
||||
if json_key is None:
|
||||
continue
|
||||
if python_key == json_key:
|
||||
continue
|
||||
json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names
|
||||
if json_key_assigned_no_need_for_python_key:
|
||||
del result[python_key]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@@ -1632,12 +1632,20 @@ def model_to_dict(model_instance, serialize=True):
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas:
|
||||
model_instances.extend(model_instance._composed_instances)
|
||||
seen_json_attribute_names = set()
|
||||
used_fallback_python_attribute_names = set()
|
||||
py_to_json_map = {}
|
||||
for model_instance in model_instances:
|
||||
for attr, value in model_instance._data_store.items():
|
||||
if serialize:
|
||||
# we use get here because additional property key names do not
|
||||
# exist in attribute_map
|
||||
attr = model_instance.attribute_map.get(attr, attr)
|
||||
try:
|
||||
attr = model_instance.attribute_map[attr]
|
||||
py_to_json_map.update(model_instance.attribute_map)
|
||||
seen_json_attribute_names.add(attr)
|
||||
except KeyError:
|
||||
used_fallback_python_attribute_names.add(attr)
|
||||
if isinstance(value, list):
|
||||
if not value:
|
||||
# empty list or None
|
||||
@@ -1665,6 +1673,16 @@ def model_to_dict(model_instance, serialize=True):
|
||||
result[attr] = model_to_dict(value, serialize=serialize)
|
||||
else:
|
||||
result[attr] = value
|
||||
if serialize:
|
||||
for python_key in used_fallback_python_attribute_names:
|
||||
json_key = py_to_json_map.get(python_key)
|
||||
if json_key is None:
|
||||
continue
|
||||
if python_key == json_key:
|
||||
continue
|
||||
json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names
|
||||
if json_key_assigned_no_need_for_python_key:
|
||||
del result[python_key]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@@ -1632,12 +1632,20 @@ def model_to_dict(model_instance, serialize=True):
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas:
|
||||
model_instances.extend(model_instance._composed_instances)
|
||||
seen_json_attribute_names = set()
|
||||
used_fallback_python_attribute_names = set()
|
||||
py_to_json_map = {}
|
||||
for model_instance in model_instances:
|
||||
for attr, value in model_instance._data_store.items():
|
||||
if serialize:
|
||||
# we use get here because additional property key names do not
|
||||
# exist in attribute_map
|
||||
attr = model_instance.attribute_map.get(attr, attr)
|
||||
try:
|
||||
attr = model_instance.attribute_map[attr]
|
||||
py_to_json_map.update(model_instance.attribute_map)
|
||||
seen_json_attribute_names.add(attr)
|
||||
except KeyError:
|
||||
used_fallback_python_attribute_names.add(attr)
|
||||
if isinstance(value, list):
|
||||
if not value:
|
||||
# empty list or None
|
||||
@@ -1665,6 +1673,16 @@ def model_to_dict(model_instance, serialize=True):
|
||||
result[attr] = model_to_dict(value, serialize=serialize)
|
||||
else:
|
||||
result[attr] = value
|
||||
if serialize:
|
||||
for python_key in used_fallback_python_attribute_names:
|
||||
json_key = py_to_json_map.get(python_key)
|
||||
if json_key is None:
|
||||
continue
|
||||
if python_key == json_key:
|
||||
continue
|
||||
json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names
|
||||
if json_key_assigned_no_need_for_python_key:
|
||||
del result[python_key]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ docs/EnumTest.md
|
||||
docs/EquilateralTriangle.md
|
||||
docs/FakeApi.md
|
||||
docs/FakeClassnameTags123Api.md
|
||||
docs/FakeGetInlineAdditionalPropertiesPayloadArrayData.md
|
||||
docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md
|
||||
docs/File.md
|
||||
docs/FileSchemaTestClass.md
|
||||
docs/Foo.md
|
||||
@@ -150,7 +150,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/fake_post_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
|
||||
|
||||
@@ -91,11 +91,11 @@ 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 |
|
||||
*FakeApi* | [**post_inline_additional_properties_payload**](docs/FakeApi.md#post_inline_additional_properties_payload) | **POST** /fake/postInlineAdditionalPropertiesPayload |
|
||||
*FakeApi* | [**post_inline_additional_properties_ref_payload**](docs/FakeApi.md#post_inline_additional_properties_ref_payload) | **POST** /fake/postInlineAdditionalPropertiesRefPayload |
|
||||
*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string |
|
||||
*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum |
|
||||
*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
|
||||
@@ -168,7 +168,7 @@ Class | Method | HTTP request | Description
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
- [EquilateralTriangle](docs/EquilateralTriangle.md)
|
||||
- [FakeGetInlineAdditionalPropertiesPayloadArrayData](docs/FakeGetInlineAdditionalPropertiesPayloadArrayData.md)
|
||||
- [FakePostInlineAdditionalPropertiesPayloadArrayData](docs/FakePostInlineAdditionalPropertiesPayloadArrayData.md)
|
||||
- [File](docs/File.md)
|
||||
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [Foo](docs/Foo.md)
|
||||
|
||||
@@ -12,11 +12,11 @@ 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 |
|
||||
[**post_inline_additional_properties_payload**](FakeApi.md#post_inline_additional_properties_payload) | **POST** /fake/postInlineAdditionalPropertiesPayload |
|
||||
[**post_inline_additional_properties_ref_payload**](FakeApi.md#post_inline_additional_properties_ref_payload) | **POST** /fake/postInlineAdditionalPropertiesRefPayload |
|
||||
[**string**](FakeApi.md#string) | **POST** /fake/refs/string |
|
||||
[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum |
|
||||
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
|
||||
@@ -564,148 +564,6 @@ 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)
|
||||
|
||||
@@ -908,6 +766,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)
|
||||
|
||||
# **post_inline_additional_properties_payload**
|
||||
> InlineObject6 post_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=[
|
||||
FakePostInlineAdditionalPropertiesPayloadArrayData(
|
||||
labels=[
|
||||
"labels_example",
|
||||
],
|
||||
),
|
||||
],
|
||||
) # InlineObject6 | (optional)
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
# and optional values
|
||||
try:
|
||||
api_response = api_instance.post_inline_additional_properties_payload(inline_object6=inline_object6)
|
||||
pprint(api_response)
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling FakeApi->post_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)
|
||||
|
||||
# **post_inline_additional_properties_ref_payload**
|
||||
> InlineAdditionalPropertiesRefPayload post_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=[
|
||||
FakePostInlineAdditionalPropertiesPayloadArrayData(
|
||||
labels=[
|
||||
"labels_example",
|
||||
],
|
||||
),
|
||||
],
|
||||
) # InlineAdditionalPropertiesRefPayload | (optional)
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
# and optional values
|
||||
try:
|
||||
api_response = api_instance.post_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->post_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)
|
||||
|
||||
# **string**
|
||||
> str string()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
# FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
|
||||
|
||||
## Properties
|
||||
@@ -5,7 +5,7 @@ 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]
|
||||
**array_data** | [**[FakePostInlineAdditionalPropertiesPayloadArrayData], none_type**](FakePostInlineAdditionalPropertiesPayloadArrayData.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)
|
||||
|
||||
@@ -5,7 +5,7 @@ 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]
|
||||
**array_data** | [**[FakePostInlineAdditionalPropertiesPayloadArrayData], none_type**](FakePostInlineAdditionalPropertiesPayloadArrayData.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)
|
||||
|
||||
@@ -945,228 +945,6 @@ 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,
|
||||
@@ -1509,6 +1287,228 @@ class FakeApi(object):
|
||||
callable=__object_model_with_ref_props
|
||||
)
|
||||
|
||||
def __post_inline_additional_properties_payload(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""post_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.post_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.post_inline_additional_properties_payload = _Endpoint(
|
||||
settings={
|
||||
'response_type': (InlineObject6,),
|
||||
'auth': [],
|
||||
'endpoint_path': '/fake/postInlineAdditionalPropertiesPayload',
|
||||
'operation_id': 'post_inline_additional_properties_payload',
|
||||
'http_method': 'POST',
|
||||
'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=__post_inline_additional_properties_payload
|
||||
)
|
||||
|
||||
def __post_inline_additional_properties_ref_payload(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""post_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.post_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.post_inline_additional_properties_ref_payload = _Endpoint(
|
||||
settings={
|
||||
'response_type': (InlineAdditionalPropertiesRefPayload,),
|
||||
'auth': [],
|
||||
'endpoint_path': '/fake/postInlineAdditionalPropertiesRefPayload',
|
||||
'operation_id': 'post_inline_additional_properties_ref_payload',
|
||||
'http_method': 'POST',
|
||||
'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=__post_inline_additional_properties_ref_payload
|
||||
)
|
||||
|
||||
def __string(
|
||||
self,
|
||||
**kwargs
|
||||
|
||||
@@ -30,7 +30,7 @@ from petstore_api.exceptions import ApiAttributeError
|
||||
|
||||
|
||||
|
||||
class FakeGetInlineAdditionalPropertiesPayloadArrayData(ModelNormal):
|
||||
class FakePostInlineAdditionalPropertiesPayloadArrayData(ModelNormal):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
@@ -101,7 +101,7 @@ class FakeGetInlineAdditionalPropertiesPayloadArrayData(ModelNormal):
|
||||
@classmethod
|
||||
@convert_js_args_to_python_args
|
||||
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
|
||||
"""FakeGetInlineAdditionalPropertiesPayloadArrayData - a model defined in OpenAPI
|
||||
"""FakePostInlineAdditionalPropertiesPayloadArrayData - a model defined in OpenAPI
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
@@ -183,7 +183,7 @@ class FakeGetInlineAdditionalPropertiesPayloadArrayData(ModelNormal):
|
||||
|
||||
@convert_js_args_to_python_args
|
||||
def __init__(self, *args, **kwargs): # noqa: E501
|
||||
"""FakeGetInlineAdditionalPropertiesPayloadArrayData - a model defined in OpenAPI
|
||||
"""FakePostInlineAdditionalPropertiesPayloadArrayData - a model defined in OpenAPI
|
||||
|
||||
Keyword Args:
|
||||
_check_type (bool): if True, values for parameters in openapi_types
|
||||
@@ -30,8 +30,8 @@ from petstore_api.exceptions import ApiAttributeError
|
||||
|
||||
|
||||
def lazy_import():
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakeGetInlineAdditionalPropertiesPayloadArrayData'] = FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakePostInlineAdditionalPropertiesPayloadArrayData'] = FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
|
||||
|
||||
class InlineAdditionalPropertiesRefPayload(ModelNormal):
|
||||
@@ -87,7 +87,7 @@ class InlineAdditionalPropertiesRefPayload(ModelNormal):
|
||||
"""
|
||||
lazy_import()
|
||||
return {
|
||||
'array_data': ([FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type,), # noqa: E501
|
||||
'array_data': ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type,), # noqa: E501
|
||||
}
|
||||
|
||||
@cached_property
|
||||
@@ -140,7 +140,7 @@ class InlineAdditionalPropertiesRefPayload(ModelNormal):
|
||||
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
|
||||
array_data ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
@@ -222,7 +222,7 @@ class InlineAdditionalPropertiesRefPayload(ModelNormal):
|
||||
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
|
||||
array_data ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
|
||||
@@ -30,8 +30,8 @@ from petstore_api.exceptions import ApiAttributeError
|
||||
|
||||
|
||||
def lazy_import():
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakeGetInlineAdditionalPropertiesPayloadArrayData'] = FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakePostInlineAdditionalPropertiesPayloadArrayData'] = FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
|
||||
|
||||
class InlineObject6(ModelNormal):
|
||||
@@ -87,7 +87,7 @@ class InlineObject6(ModelNormal):
|
||||
"""
|
||||
lazy_import()
|
||||
return {
|
||||
'array_data': ([FakeGetInlineAdditionalPropertiesPayloadArrayData], none_type,), # noqa: E501
|
||||
'array_data': ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type,), # noqa: E501
|
||||
}
|
||||
|
||||
@cached_property
|
||||
@@ -140,7 +140,7 @@ class InlineObject6(ModelNormal):
|
||||
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
|
||||
array_data ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
@@ -222,7 +222,7 @@ class InlineObject6(ModelNormal):
|
||||
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
|
||||
array_data ([FakePostInlineAdditionalPropertiesPayloadArrayData], none_type): [optional] # noqa: E501
|
||||
"""
|
||||
|
||||
_check_type = kwargs.pop('_check_type', True)
|
||||
|
||||
@@ -1632,12 +1632,20 @@ def model_to_dict(model_instance, serialize=True):
|
||||
model_instances = [model_instance]
|
||||
if model_instance._composed_schemas:
|
||||
model_instances.extend(model_instance._composed_instances)
|
||||
seen_json_attribute_names = set()
|
||||
used_fallback_python_attribute_names = set()
|
||||
py_to_json_map = {}
|
||||
for model_instance in model_instances:
|
||||
for attr, value in model_instance._data_store.items():
|
||||
if serialize:
|
||||
# we use get here because additional property key names do not
|
||||
# exist in attribute_map
|
||||
attr = model_instance.attribute_map.get(attr, attr)
|
||||
try:
|
||||
attr = model_instance.attribute_map[attr]
|
||||
py_to_json_map.update(model_instance.attribute_map)
|
||||
seen_json_attribute_names.add(attr)
|
||||
except KeyError:
|
||||
used_fallback_python_attribute_names.add(attr)
|
||||
if isinstance(value, list):
|
||||
if not value:
|
||||
# empty list or None
|
||||
@@ -1665,6 +1673,16 @@ def model_to_dict(model_instance, serialize=True):
|
||||
result[attr] = model_to_dict(value, serialize=serialize)
|
||||
else:
|
||||
result[attr] = value
|
||||
if serialize:
|
||||
for python_key in used_fallback_python_attribute_names:
|
||||
json_key = py_to_json_map.get(python_key)
|
||||
if json_key is None:
|
||||
continue
|
||||
if python_key == json_key:
|
||||
continue
|
||||
json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names
|
||||
if json_key_assigned_no_need_for_python_key:
|
||||
del result[python_key]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@@ -43,7 +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.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.file import File
|
||||
from petstore_api.model.file_schema_test_class import FileSchemaTestClass
|
||||
from petstore_api.model.foo import Foo
|
||||
|
||||
@@ -12,11 +12,11 @@ import sys
|
||||
import unittest
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.model.fake_get_inline_additional_properties_payload_array_data import FakeGetInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
|
||||
|
||||
class TestFakeGetInlineAdditionalPropertiesPayloadArrayData(unittest.TestCase):
|
||||
"""FakeGetInlineAdditionalPropertiesPayloadArrayData unit test stubs"""
|
||||
class TestFakePostInlineAdditionalPropertiesPayloadArrayData(unittest.TestCase):
|
||||
"""FakePostInlineAdditionalPropertiesPayloadArrayData unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
@@ -24,10 +24,10 @@ class TestFakeGetInlineAdditionalPropertiesPayloadArrayData(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def testFakeGetInlineAdditionalPropertiesPayloadArrayData(self):
|
||||
"""Test FakeGetInlineAdditionalPropertiesPayloadArrayData"""
|
||||
def testFakePostInlineAdditionalPropertiesPayloadArrayData(self):
|
||||
"""Test FakePostInlineAdditionalPropertiesPayloadArrayData"""
|
||||
# FIXME: construct object with mandatory attributes with example values
|
||||
# model = FakeGetInlineAdditionalPropertiesPayloadArrayData() # noqa: E501
|
||||
# model = FakePostInlineAdditionalPropertiesPayloadArrayData() # noqa: E501
|
||||
pass
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ 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.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakePostInlineAdditionalPropertiesPayloadArrayData'] = FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.inline_additional_properties_ref_payload import InlineAdditionalPropertiesRefPayload
|
||||
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ 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.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
globals()['FakePostInlineAdditionalPropertiesPayloadArrayData'] = FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
from petstore_api.model.inline_object6 import InlineObject6
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from unittest.mock import patch
|
||||
import petstore_api
|
||||
from petstore_api.api.fake_api import FakeApi # noqa: E501
|
||||
from petstore_api.rest import RESTClientObject, RESTResponse
|
||||
from petstore_api.model_utils import file_type
|
||||
from petstore_api.model_utils import file_type, model_to_dict
|
||||
|
||||
HTTPResponse = namedtuple(
|
||||
'urllib3_response_HTTPResponse',
|
||||
@@ -59,14 +59,15 @@ class TestFakeApi(unittest.TestCase):
|
||||
url,
|
||||
accept='application/json',
|
||||
http_method='POST',
|
||||
content_type='application/json',
|
||||
**kwargs
|
||||
):
|
||||
headers = {
|
||||
'Accept': accept,
|
||||
'User-Agent': 'OpenAPI-Generator/1.0.0/python',
|
||||
}
|
||||
if 'content_type' in kwargs:
|
||||
headers['Content-Type'] = kwargs['content_type']
|
||||
if content_type:
|
||||
headers['Content-Type'] = content_type
|
||||
used_kwargs = dict(
|
||||
_preload_content=True,
|
||||
_request_timeout=None,
|
||||
@@ -77,7 +78,8 @@ class TestFakeApi(unittest.TestCase):
|
||||
used_kwargs['post_params'] = kwargs['post_params']
|
||||
if 'body' in kwargs:
|
||||
used_kwargs['body'] = kwargs['body']
|
||||
else:
|
||||
if 'post_params' not in used_kwargs:
|
||||
used_kwargs['post_params'] = []
|
||||
mock_method.assert_called_with(
|
||||
http_method,
|
||||
url,
|
||||
@@ -101,7 +103,11 @@ class TestFakeApi(unittest.TestCase):
|
||||
mock_method.return_value = self.mock_response(json_data)
|
||||
|
||||
response = endpoint(body=body)
|
||||
self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/arraymodel', body=json_data)
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/arraymodel',
|
||||
body=json_data,
|
||||
)
|
||||
|
||||
assert isinstance(response, animal_farm.AnimalFarm)
|
||||
assert response == body
|
||||
@@ -158,7 +164,10 @@ class TestFakeApi(unittest.TestCase):
|
||||
|
||||
response = endpoint(enum_test=body)
|
||||
self.assert_request_called_with(
|
||||
mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/enum-test', body=json_value)
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/enum-test',
|
||||
body=json_value,
|
||||
)
|
||||
|
||||
assert isinstance(response, EnumTest)
|
||||
assert response == body
|
||||
@@ -174,7 +183,10 @@ class TestFakeApi(unittest.TestCase):
|
||||
|
||||
response = endpoint(enum_test=body)
|
||||
self.assert_request_called_with(
|
||||
mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/enum-test', body=json_value)
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/enum-test',
|
||||
body=json_value,
|
||||
)
|
||||
|
||||
assert isinstance(response, EnumTest)
|
||||
assert response == body
|
||||
@@ -198,7 +210,11 @@ class TestFakeApi(unittest.TestCase):
|
||||
mock_method.return_value = self.mock_response(value_simple)
|
||||
|
||||
response = endpoint(array_of_enums=body)
|
||||
self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', body=value_simple)
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums',
|
||||
body=value_simple,
|
||||
)
|
||||
|
||||
assert isinstance(response, array_of_enums.ArrayOfEnums)
|
||||
assert response.value == value
|
||||
@@ -219,7 +235,11 @@ class TestFakeApi(unittest.TestCase):
|
||||
mock_method.return_value = self.mock_response(value)
|
||||
|
||||
response = endpoint(body=body)
|
||||
self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/number', body=value)
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/number',
|
||||
body=value,
|
||||
)
|
||||
|
||||
assert isinstance(response, number_with_validations.NumberWithValidations)
|
||||
assert response.value == value
|
||||
@@ -262,7 +282,7 @@ class TestFakeApi(unittest.TestCase):
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/object_model_with_ref_props',
|
||||
body=json_payload
|
||||
body=json_payload,
|
||||
)
|
||||
|
||||
assert isinstance(response, expected_model.__class__)
|
||||
@@ -300,7 +320,7 @@ class TestFakeApi(unittest.TestCase):
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations',
|
||||
body=value_simple
|
||||
body=value_simple,
|
||||
)
|
||||
|
||||
assert isinstance(response, body.__class__)
|
||||
@@ -321,7 +341,11 @@ class TestFakeApi(unittest.TestCase):
|
||||
mock_method.return_value = self.mock_response(value_simple)
|
||||
|
||||
response = endpoint(body=body)
|
||||
self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/string', body=value_simple)
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/string',
|
||||
body=value_simple,
|
||||
)
|
||||
|
||||
assert isinstance(response, str)
|
||||
assert response == value_simple
|
||||
@@ -343,7 +367,11 @@ class TestFakeApi(unittest.TestCase):
|
||||
mock_method.return_value = self.mock_response(value)
|
||||
|
||||
response = endpoint(body=body)
|
||||
self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/enum', body=value)
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/refs/enum',
|
||||
body=value,
|
||||
)
|
||||
|
||||
assert isinstance(response, string_enum.StringEnum)
|
||||
assert response.value == value
|
||||
@@ -495,6 +523,7 @@ class TestFakeApi(unittest.TestCase):
|
||||
'http://www.jtricks.com/download-text',
|
||||
http_method='GET',
|
||||
accept='text/plain',
|
||||
content_type=None,
|
||||
)
|
||||
self.assertTrue(isinstance(file_object, file_type))
|
||||
self.assertFalse(file_object.closed)
|
||||
@@ -532,8 +561,11 @@ class TestFakeApi(unittest.TestCase):
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/uploadDownloadFile',
|
||||
body=expected_file_data, content_type='application/octet-stream'
|
||||
body=expected_file_data,
|
||||
content_type='application/octet-stream',
|
||||
accept='application/octet-stream'
|
||||
)
|
||||
|
||||
self.assertTrue(isinstance(downloaded_file, file_type))
|
||||
self.assertFalse(downloaded_file.closed)
|
||||
self.assertEqual(downloaded_file.read(), expected_file_data)
|
||||
@@ -604,12 +636,12 @@ class TestFakeApi(unittest.TestCase):
|
||||
"""
|
||||
pass
|
||||
|
||||
def test_get_inline_additional_properties_ref_payload(self):
|
||||
"""Test case for getInlineAdditionlPropertiesRefPayload
|
||||
def test_post_inline_additional_properties_ref_payload(self):
|
||||
"""Test case for postInlineAdditionlPropertiesRefPayload
|
||||
"""
|
||||
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
|
||||
from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
endpoint = self.api.post_inline_additional_properties_ref_payload
|
||||
assert endpoint.openapi_types['inline_additional_properties_ref_payload'] == (InlineAdditionalPropertiesRefPayload,)
|
||||
assert endpoint.settings['response_type'] == (InlineAdditionalPropertiesRefPayload,)
|
||||
|
||||
@@ -617,7 +649,7 @@ class TestFakeApi(unittest.TestCase):
|
||||
from petstore_api.rest import RESTClientObject, RESTResponse
|
||||
with patch.object(RESTClientObject, 'request') as mock_method:
|
||||
expected_json_body = {
|
||||
'array_data': [
|
||||
'arrayData': [
|
||||
{
|
||||
'labels': [
|
||||
None,
|
||||
@@ -628,23 +660,27 @@ class TestFakeApi(unittest.TestCase):
|
||||
}
|
||||
inline_additional_properties_ref_payload = InlineAdditionalPropertiesRefPayload(
|
||||
array_data=[
|
||||
FakeGetInlineAdditionalPropertiesPayloadArrayData(labels=[None, 'foo'])
|
||||
FakePostInlineAdditionalPropertiesPayloadArrayData(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)
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesRefPayload',
|
||||
body=expected_json_body
|
||||
)
|
||||
|
||||
assert isinstance(response, InlineAdditionalPropertiesRefPayload)
|
||||
assert response.to_dict() == expected_json_body
|
||||
assert model_to_dict(response) == expected_json_body
|
||||
|
||||
def test_get_inline_additional_properties_payload(self):
|
||||
"""Test case for getInlineAdditionlPropertiesPayload
|
||||
def test_post_inline_additional_properties_payload(self):
|
||||
"""Test case for postInlineAdditionlPropertiesPayload
|
||||
"""
|
||||
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
|
||||
from petstore_api.model.fake_post_inline_additional_properties_payload_array_data import FakePostInlineAdditionalPropertiesPayloadArrayData
|
||||
endpoint = self.api.post_inline_additional_properties_payload
|
||||
assert endpoint.openapi_types['inline_object6'] == (InlineObject6,)
|
||||
assert endpoint.settings['response_type'] == (InlineObject6,)
|
||||
|
||||
@@ -652,7 +688,7 @@ class TestFakeApi(unittest.TestCase):
|
||||
from petstore_api.rest import RESTClientObject, RESTResponse
|
||||
with patch.object(RESTClientObject, 'request') as mock_method:
|
||||
expected_json_body = {
|
||||
'array_data': [
|
||||
'arrayData': [
|
||||
{
|
||||
'labels': [
|
||||
None,
|
||||
@@ -663,16 +699,20 @@ class TestFakeApi(unittest.TestCase):
|
||||
}
|
||||
inline_object6 = InlineObject6(
|
||||
array_data=[
|
||||
FakeGetInlineAdditionalPropertiesPayloadArrayData(labels=[None, 'foo'])
|
||||
FakePostInlineAdditionalPropertiesPayloadArrayData(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)
|
||||
self.assert_request_called_with(
|
||||
mock_method,
|
||||
'http://petstore.swagger.io:80/v2/fake/postInlineAdditionalPropertiesPayload',
|
||||
body=expected_json_body
|
||||
)
|
||||
|
||||
assert isinstance(response, InlineObject6)
|
||||
assert response.to_dict() == expected_json_body
|
||||
assert model_to_dict(response) == expected_json_body
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user