mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-09 20:37:46 +00:00
Preserving the multiplicity of array type query parameters (#500)
* Preserving the multiplicity of array type query parameters * Resolved failing tests, and refactored code block into a method * Added tests for multi array * Refactored parameter.py and updated tests in test_parameters.py
This commit is contained in:
committed by
Henning Jacobs
parent
08dd554ad3
commit
f36c24685b
@@ -54,6 +54,14 @@ def test_array_query_param(simple_app):
|
||||
response = app_client.get(url, headers=headers)
|
||||
array_response = json.loads(response.data.decode('utf-8', 'replace')) # [str] unsupported collectionFormat
|
||||
assert array_response == ["1;2;3"]
|
||||
url = '/v1.0/test_array_csv_query_param?items=A&items=B&items=C&items=D,E,F'
|
||||
response = app_client.get(url, headers=headers)
|
||||
array_response = json.loads(response.data.decode('utf-8', 'replace')) # type: [str] multi array with csv format
|
||||
assert array_response == ['A', 'B', 'C', 'D', 'E', 'F']
|
||||
url = '/v1.0/test_array_pipes_query_param?items=4&items=5&items=6&items=7|8|9'
|
||||
response = app_client.get(url, headers=headers)
|
||||
array_response = json.loads(response.data.decode('utf-8', 'replace')) # type: [int] multi array with pipes format
|
||||
assert array_response == [4, 5, 6, 7, 8, 9]
|
||||
|
||||
|
||||
def test_extra_query_param(simple_app):
|
||||
|
||||
Reference in New Issue
Block a user