forked from loafle/openapi-generator-original
[python] Add tests and fix enum path parameters (#16769)
* test: Tests for enum params in path, query and header * fix: Get enum ref values correctly in path parameters Closes #16688 * fix java tests failure --------- Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **test_enum_ref_string**
|
||||
> str test_enum_ref_string(enum_ref_string_query=enum_ref_string_query)
|
||||
> str test_enum_ref_string(enum_nonref_string_query=enum_nonref_string_query, enum_ref_string_query=enum_ref_string_query)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
@@ -42,11 +42,12 @@ configuration = openapi_client.Configuration(
|
||||
with openapi_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = openapi_client.QueryApi(api_client)
|
||||
enum_nonref_string_query = 'enum_nonref_string_query_example' # str | (optional)
|
||||
enum_ref_string_query = openapi_client.StringEnumRef() # StringEnumRef | (optional)
|
||||
|
||||
try:
|
||||
# Test query parameter(s)
|
||||
api_response = api_instance.test_enum_ref_string(enum_ref_string_query=enum_ref_string_query)
|
||||
api_response = api_instance.test_enum_ref_string(enum_nonref_string_query=enum_nonref_string_query, enum_ref_string_query=enum_ref_string_query)
|
||||
print("The response of QueryApi->test_enum_ref_string:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
@@ -59,6 +60,7 @@ with openapi_client.ApiClient(configuration) as api_client:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enum_nonref_string_query** | **str**| | [optional]
|
||||
**enum_ref_string_query** | [**StringEnumRef**](.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
Reference in New Issue
Block a user