mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 08:47:05 +00:00
[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 @@ All URIs are relative to *http://localhost:3000*
|
||||
|
||||
<a id="testenumrefstring"></a>
|
||||
# **TestEnumRefString**
|
||||
> string TestEnumRefString (StringEnumRef? enumRefStringQuery = null)
|
||||
> string TestEnumRefString (string? enumNonrefStringQuery = null, StringEnumRef? enumRefStringQuery = null)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
@@ -38,12 +38,13 @@ namespace Example
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://localhost:3000";
|
||||
var apiInstance = new QueryApi(config);
|
||||
var enumNonrefStringQuery = "success"; // string? | (optional)
|
||||
var enumRefStringQuery = new StringEnumRef?(); // StringEnumRef? | (optional)
|
||||
|
||||
try
|
||||
{
|
||||
// Test query parameter(s)
|
||||
string result = apiInstance.TestEnumRefString(enumRefStringQuery);
|
||||
string result = apiInstance.TestEnumRefString(enumNonrefStringQuery, enumRefStringQuery);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (ApiException e)
|
||||
@@ -64,7 +65,7 @@ This returns an ApiResponse object which contains the response data, status code
|
||||
try
|
||||
{
|
||||
// Test query parameter(s)
|
||||
ApiResponse<string> response = apiInstance.TestEnumRefStringWithHttpInfo(enumRefStringQuery);
|
||||
ApiResponse<string> response = apiInstance.TestEnumRefStringWithHttpInfo(enumNonrefStringQuery, enumRefStringQuery);
|
||||
Debug.Write("Status Code: " + response.StatusCode);
|
||||
Debug.Write("Response Headers: " + response.Headers);
|
||||
Debug.Write("Response Body: " + response.Data);
|
||||
@@ -81,6 +82,7 @@ catch (ApiException e)
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **enumNonrefStringQuery** | **string?** | | [optional] |
|
||||
| **enumRefStringQuery** | [**StringEnumRef?**](StringEnumRef?.md) | | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
Reference in New Issue
Block a user