Skip to content

Commit

Permalink
fix: Get enum ref values correctly in path parameters
Browse files Browse the repository at this point in the history
Closes #16688
  • Loading branch information
robertschweizer committed Oct 9, 2023
1 parent 821f4c0 commit 349a551
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class {{classname}}:
_path_params: Dict[str, str] = {}
{{#pathParams}}
if _params['{{paramName}}'] is not None:
_path_params['{{baseName}}'] = _params['{{paramName}}']
_path_params['{{baseName}}'] = _params['{{paramName}}']{{#isEnumRef}}.value{{/isEnumRef}}
{{#isArray}}
_collection_formats['{{baseName}}'] = '{{collectionFormat}}'
{{/isArray}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_e
_path_params['enum_nonref_string_path'] = _params['enum_nonref_string_path']

if _params['enum_ref_string_path'] is not None:
_path_params['enum_ref_string_path'] = _params['enum_ref_string_path']
_path_params['enum_ref_string_path'] = _params['enum_ref_string_path'].value


# process the query parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def tests_path_string_path_string_integer_path_integer_enum_nonref_string_path_e
_path_params['enum_nonref_string_path'] = _params['enum_nonref_string_path']

if _params['enum_ref_string_path'] is not None:
_path_params['enum_ref_string_path'] = _params['enum_ref_string_path']
_path_params['enum_ref_string_path'] = _params['enum_ref_string_path'].value


# process the query parameters
Expand Down
2 changes: 1 addition & 1 deletion samples/client/echo_api/python/test/test_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def testPathParameters(self):
enum_ref_string_path=openapi_client.StringEnumRef.FAILURE,
)
e = EchoServerResponseParser(api_response)
self.assertEqual(e.path, "/path/string/string_value/integer/123/success/StringEnumRef.FAILURE")
self.assertEqual(e.path, "/path/string/string_value/integer/123/success/failure")

def testHeaderParameters(self):
api_instance = openapi_client.HeaderApi()
Expand Down

0 comments on commit 349a551

Please sign in to comment.