mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +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:
@@ -4,11 +4,11 @@ All URIs are relative to *http://localhost:3000*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**tests_path_string_path_string_integer_path_integer**](PathApi.md#tests_path_string_path_string_integer_path_integer) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s)
|
||||
[**tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path**](PathApi.md#tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
|
||||
|
||||
|
||||
# **tests_path_string_path_string_integer_path_integer**
|
||||
> str tests_path_string_path_string_integer_path_integer(path_string, path_integer)
|
||||
# **tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path**
|
||||
> str tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path)
|
||||
|
||||
Test path parameter(s)
|
||||
|
||||
@@ -20,6 +20,7 @@ Test path parameter(s)
|
||||
import time
|
||||
import os
|
||||
import openapi_client
|
||||
from openapi_client.models.string_enum_ref import StringEnumRef
|
||||
from openapi_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
@@ -36,14 +37,16 @@ with openapi_client.ApiClient(configuration) as api_client:
|
||||
api_instance = openapi_client.PathApi(api_client)
|
||||
path_string = 'path_string_example' # str |
|
||||
path_integer = 56 # int |
|
||||
enum_nonref_string_path = 'enum_nonref_string_path_example' # str |
|
||||
enum_ref_string_path = openapi_client.StringEnumRef() # StringEnumRef |
|
||||
|
||||
try:
|
||||
# Test path parameter(s)
|
||||
api_response = api_instance.tests_path_string_path_string_integer_path_integer(path_string, path_integer)
|
||||
print("The response of PathApi->tests_path_string_path_string_integer_path_integer:\n")
|
||||
api_response = api_instance.tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path(path_string, path_integer, enum_nonref_string_path, enum_ref_string_path)
|
||||
print("The response of PathApi->tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling PathApi->tests_path_string_path_string_integer_path_integer: %s\n" % e)
|
||||
print("Exception when calling PathApi->tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_enum_ref_string_path: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
@@ -54,6 +57,8 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**path_string** | **str**| |
|
||||
**path_integer** | **int**| |
|
||||
**enum_nonref_string_path** | **str**| |
|
||||
**enum_ref_string_path** | [**StringEnumRef**](.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
Reference in New Issue
Block a user