-
-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for when parameter spec is unordered.
- Loading branch information
Arjun Naik
committed
May 17, 2016
1 parent
bb0d34a
commit dba916c
Showing
5 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import json | ||
|
||
|
||
def test_app(unordered_definition_app): | ||
app_client = unordered_definition_app.app.test_client() | ||
response = app_client.get('/v1.0/unordered-params/1?first=first&second=2') # type: flask.Response | ||
assert response.status_code == 400 | ||
response_data = json.loads(response.data.decode()) | ||
assert response_data['detail'] == 'Wrong type, expected \'integer\' for query parameter \'first\'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
swagger: "2.0" | ||
|
||
info: | ||
title: "{{title}}" | ||
version: "1.0" | ||
|
||
basePath: /v1.0 | ||
|
||
paths: | ||
/unordered-params/{path_param}: | ||
get: | ||
summary: Mixed parameters in swagger definition | ||
operationId: fakeapi.hello.unordered_params_response | ||
responses: | ||
200: | ||
description: OK | ||
parameters: | ||
- name: first | ||
in: query | ||
type: integer | ||
description: First Param | ||
- name: path_param | ||
in: path | ||
required: true | ||
type: string | ||
description: Path Param | ||
- name: second | ||
in: query | ||
type: integer | ||
description: Second Param |