Commit Graph

22 Commits

Author SHA1 Message Date
Daniel Grossmann-Kavanagh
2f074998e3 URI parsing decorator (#613)
- array logic refactored into one place.
- validation.py and parameter.py no longer try to join the array, and the split it again.
- validation of defaults now works, because the validator is given the correct type.
- some additional classes that change the behavior of deduplicating query parameters that are defined multiple times
  - **AlwaysMultiURIParser** that is backwards compatible, warts and all (used by default)
  - **Swagger2URIParser** that adheres to the spec's definition of `collectionFormat: multi` and uses the last-defined query parameter value (ex. `query?a=1&a=2` => `a = 2`)
  - **FirstValueURIParser** that behaves like Swagger2URIParser, except that the first-defined value is used (ex. `query?a=1&a=2` => `a=1`)
2018-07-09 11:06:24 +02:00
Lance Hannestad
f36c24685b 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
2017-09-08 15:18:47 +02:00
Ronaldo Ferreira
f2923148f8 Fix UnicodeEncodeError for query-strings on Python 2 (#507)
* Fix UnicodeEncodeError for query-strings on Python 2

* Fix test for Python 3.4 and 3.5
2017-08-28 18:52:10 +02:00
Rafael Carício
1858c9d4a0 Flask required only if necessary (#424)
* Example with Flask support

* Only show import error when trying to use Flask

* Re-organize imports

* Move flask_utils next to related module

* Code style

* Change back to incentivizes

* Includes Flask by default

* Project clean up

* Update Rafael Caricio's e-mail address

* Fix conflicts
2017-04-04 20:48:08 +02:00
Dan Ballance
702142ec48 Fixes #340 | Convert camelcased parameter names to Python style 2017-03-09 16:42:17 +00:00
Leena Bhegade
f7b3d9a0bb add parameter to decode 2017-02-08 23:48:04 +00:00
Leena Bhegade
c1020bf0f6 Fix tests 2017-02-08 21:31:35 +00:00
Michael Wild
b638b1168e Adds parameter name sanitization in parameters_to_args()
Without sanitization e.g. OData query parameters, such as $skip, $top,
$filter cannot be passed to the controller (except by use of **kwargs).

Fixes: zalando/connexion#334
2016-10-31 15:16:03 +01:00
Rafael Caricio
c02fad46f7 Fix import ordering 2016-09-13 11:12:45 +02:00
Henning Jacobs
b5cd358b4f #270 add test for kwargs 2016-09-01 12:06:04 +02:00
Dylan Semler
b7c6dede95 Add flag for strict_validation on extra parameters 2016-07-31 20:21:19 -04:00
Dylan Semler
f1d436c859 Validate that requests don't have extra parameters
Request validation is enhanced to verify requests only include query or
formData parameters that are specified in the spec.

This validation does not occur for header or path parameters.  This is
because most applications probably prefer to ignore extra headers and
a request with extra path parameters would point to a different
endpoint.
2016-07-31 20:17:30 -04:00
Greg Brockman
a6cc07cca8 Make JSON printing a bit nicer 2016-04-04 21:59:54 -07:00
João Santos
ddcb4ce4a5 Merge pull request #197 from rafaelcaricio/accept-nullable-values
Support nullable parameters
2016-03-31 14:10:17 +02:00
David Hotham
75fe338937 Python3 compatibility 2016-03-29 12:21:31 +01:00
David Hotham
c3ced5fc2d Add validation of formData parameters 2016-03-29 11:58:33 +01:00
David Hotham
604e7274f1 Unit tests for file uploads 2016-03-29 10:09:56 +01:00
Rafael Caricio
75c94a428b Support x-nullable in body parameters 2016-03-25 19:31:33 +01:00
Rafael Caricio
7052ff3722 Support x-nullable parameters 2016-03-25 18:07:35 +01:00
João Santos
625c60beaa #173 Fix unpythonic function names 2016-03-08 08:33:46 +01:00
Rafael Caricio
2558a611f4 #104 typecasting in path parameters 2016-03-04 18:41:57 +01:00
Rafael Caricio
a7aec5d53c Split tests in isolated modules 2016-02-25 14:49:19 +01:00