mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 12:27:45 +00:00
When using an OAS3 spec with formdata, the validation logic looks for the key 'formData' in the spec parameters list. This keys is specific to OAS2, and will never be present, causing any form data to throw an ExtraParameterProblem.
This commit is contained in:
committed by
Henning Jacobs
parent
1abab0653f
commit
ab430afaf5
@@ -117,6 +117,16 @@ def test_strict_extra_query_param(strict_app):
|
||||
assert response['detail'] == "Extra query parameter(s) extra_parameter not in spec"
|
||||
|
||||
|
||||
def test_strict_formdata_param(strict_app):
|
||||
app_client = strict_app.app.test_client()
|
||||
headers = {'Content-type': 'application/x-www-form-urlencoded'}
|
||||
url = '/v1.0/test_array_csv_form_param'
|
||||
resp = app_client.post(url, headers=headers, data={"items":"mango"})
|
||||
response = json.loads(resp.data.decode('utf-8', 'replace'))
|
||||
assert response == ['mango']
|
||||
assert resp.status_code == 200
|
||||
|
||||
|
||||
def test_path_parameter_someint(simple_app):
|
||||
app_client = simple_app.app.test_client()
|
||||
resp = app_client.get('/v1.0/test-int-path/123') # type: flask.Response
|
||||
|
||||
Reference in New Issue
Block a user