Python: Correctly serialize enum with its value (#18327) (#18328)

This commit is contained in:
BaptisteSaves
2024-04-10 15:12:37 +02:00
committed by GitHub
parent 9351217048
commit 6bcc28d06e
19 changed files with 233 additions and 30 deletions

View File

@@ -632,7 +632,7 @@ 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)
# **fake_property_enum_integer_serialize**
> OuterObjectWithEnumProperty fake_property_enum_integer_serialize(outer_object_with_enum_property)
> OuterObjectWithEnumProperty fake_property_enum_integer_serialize(outer_object_with_enum_property, param=param)
@@ -643,6 +643,7 @@ Test serialization of enum (int) properties with examples
```python
import petstore_api
from petstore_api.models.outer_enum_integer import OuterEnumInteger
from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
from petstore_api.rest import ApiException
from pprint import pprint
@@ -659,9 +660,10 @@ async with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
outer_object_with_enum_property = petstore_api.OuterObjectWithEnumProperty() # OuterObjectWithEnumProperty | Input enum (int) as post body
param = [petstore_api.OuterEnumInteger()] # List[OuterEnumInteger] | (optional)
try:
api_response = await api_instance.fake_property_enum_integer_serialize(outer_object_with_enum_property)
api_response = await api_instance.fake_property_enum_integer_serialize(outer_object_with_enum_property, param=param)
print("The response of FakeApi->fake_property_enum_integer_serialize:\n")
pprint(api_response)
except Exception as e:
@@ -676,6 +678,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outer_object_with_enum_property** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body |
**param** | [**List[OuterEnumInteger]**](OuterEnumInteger.md)| | [optional]
### Return type