Commit Graph

14 Commits

Author SHA1 Message Date
Robbe Sneyders
4734707b15 Coerce types only in uri parser 2023-01-26 15:14:45 +01:00
Robbe Sneyders
2581a7e4c4 Move parameter validation to middleware 2022-11-14 23:15:31 +01:00
Robbe Sneyders
b8bdcc999d Move Swagger 2 form validation to middleware (#1599)
* Move Swagger 2 form validation to middleware

* Add unit test for form transformation
2022-11-04 11:07:03 +01:00
Robbe Sneyders
600ed4ed94 Format files with black 2022-06-25 23:50:52 +02:00
Robbe Sneyders
0ef5f9754d Fix formdata parameter validation for OAS3 2021-06-29 09:14:38 +02:00
Robbe Sneyders
fb44e6acb4 Fix import order for isort 2021-06-25 13:08:46 +02:00
Noam Goodman
1ed14fbde5 Split header by comma (#1279)
* Split header by comma

When specifying array of enum strings in header,
it needs to be split according to commas.

* Add test

Add test where value is array of enums,
and injected as header
2020-08-10 08:51:42 +02:00
jlaba
16a896cdbf Switched from mock to unittest.mock (#1218)
* Switched from mock to unittest.mock

* Update test_validation.py

Removed mock comment

* Update test_parameter.py

Removed comment for mock

Co-authored-by: Joachim Langenbach <joachim.langenbach@engsas.de>
2020-04-23 22:59:41 +02:00
Fabian Wollert
54e50f2278 handle deepObject and explode: true (#971)
* first implementation draft

* gitignore virtualenv

* use isinstance instead of type function

* fix tests

* remove unused function

* move object parsing to uri_parsing.py

* remove not needed import

* only test for OpenAPI

* remove not needed import

* make it work for other cases again

* flake8 fixes

* python2.7 fixes

* isort fix

* address code review comments

* remove for loop and address other comments

* remove not needed abstract function

* move array unnesting into uri_parsing

* make nested arrays possible

* style fixes

* style fixes

* test other data types

* comment and simplify function

* WIP: start additionalProperties test

* test additionalProperties

* remove uneccessary exception

* set default values

* set default values also in response

* flake8 fixes

* fix test

* use suggestions from dtkav's branch

* fix tests partially

* fix tests partially

* fix tests

* fix tests

* add comments for clarity
2019-10-15 17:36:58 +02:00
Daniel Grossmann-Kavanagh
08e4536e5e bump and pin isort, apply all automatic fixes (#903)
Fixes the build.

Changes proposed in this pull request:
 - apply all of the isort changes that resulted from the latest version
 - pin to the latest version (4.3.15) so this doesn't happen again, unless we bump the version on purpose
2019-03-15 13:04:33 +01:00
Daniel Grossmann-Kavanagh
9b76bbc8fc fix openapi3 path and query validation and tests (#821) 2018-12-18 09:15:33 +01:00
João Santos
44ea9336fe Connexion 2.0 (#619)
- App and Api options must be provided through the "options" argument (``old_style_options`` have been removed).
- You must specify a form content-type in 'consumes' in order to consume form data.
- The `Operation` interface has been formalized in the `AbstractOperation` class.
- The `Operation` class has been renamed to `Swagger2Operation`.
- Array parameter deserialization now follows the Swagger 2.0 spec more closely.
  In situations when a query parameter is passed multiple times, and the collectionFormat is either csv or pipes, the right-most value will be used.
  For example, `?q=1,2,3&q=4,5,6` will result in `q = [4, 5, 6]`.
  The old behavior is available by setting the collectionFormat to `multi`, or by importing `decorators.uri_parsing.AlwaysMultiURIParser` and passing `parser_class=AlwaysMultiURIParser` to your Api.
- The spec validator library has changed from `swagger-spec-validator` to `openapi-spec-validator`.
- Errors that previously raised `SwaggerValidationError` now raise the `InvalidSpecification` exception.
  All spec validation errors should be wrapped with `InvalidSpecification`.
- Support for nullable/x-nullable, readOnly and writeOnly/x-writeOnly has been added to the standard json schema validator.
- Custom validators can now be specified on api level (instead of app level).
- Added support for basic authentication and apikey authentication
- If unsupported security requirements are defined or ``x-tokenInfoFunc``/``x-tokenInfoUrl`` is missing, connexion now denies requests instead of allowing access without security-check.
- Accessing ``connexion.request.user`` / ``flask.request.user`` is no longer supported, use ``connexion.context['user']`` instead
2018-11-05 14:50:42 +01:00
dmksnnk
1c0bd7d0f8 Add x-nullable support for body validators (#642)
* add x-nullable support for body validators

* add check for Iterable
2018-09-17 08:13:12 +02:00
wilsonge
cd5c9a9015 Add tests for the parameter validation method 2016-12-14 15:43:25 +00:00