* Extract boilerplate code into Routed base classes
* Use typing_extensions for Python 3.7 Protocol support
* Use Mock instead of AsyncMock
* Extract response validation to middleware
* Refactor Request validation to match Response validation
* Factor out shared functionality
* Fix typo in TextResponseBodyValidator class name
* Fix string formatting
* Use correct schema to check nullability in response validation
* Extract boilerplate code into Routed base classes
* Use typing_extensions for Python 3.7 Protocol support
* Use Mock instead of AsyncMock
* Turn properties into class attributes
* Removed internal variable pass_context_arg_name
* fixed issue with personalized context name in tests
* restored code from pr suggestion
* restore decorator functionality
now the function accept a pass_context_arg boolean parameter,
instead of the pass_context_arg_name value
* Fixed security test checks, now passes tests
* Removed pass_context_arg, fixed security handler
fixed security handler as suggested
removed pass_context_arg as before
* Fix context injection test
Co-authored-by: Niels Dewulf <87133686+nielsbox@users.noreply.github.com>
Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
* Set up code skeleton for validation middleware
* Add more boilerplate code
* WIP
* Add ASGI JSONBodyValidator
* Revert example changes
* Remove incorrect content type test
Co-authored-by: Ruwan <ruwanlambrichts@gmail.com>
* Fix OpenAPI parameters containing other parameters
OpenAPI parameters can be unspecified and sometimes contain other
parameters. The current behavior is to assume it's a bracket parameter
and nest the containing parameter within the contained parameter, which
breaks the schema as the original parameter now seems to contain a
nested object.
We can avert this by checking for the presence of a '[' in the
parameter.
* Trigger Github workflow
Co-authored-by: Ricardo Piro-Rael <rpiro-rael@ironox.com>
* Add test for MethodViewResolver
* Warn about ignoring of collection_endpoint_name in MethodViewResolver
* Add docstring on class_arguments in MethodViewResolver
* Fix for bug of the function is_json_mimetype() (#1114)
* Splitting the mimetype correctly
* Added a test for the json mimetype usecases
* Update connexion/utils.py
Co-authored-by: Ruwann <ruwan.lambrichts@ml6.eu>
* Fix deprecation warning for iter_errors
Bump jsonschema version to at least v4
* Bump jsonschema to v4.0.1
* Provide schema as keyword arg to evolve
* Fix evolve statement
* Fix uri parsing for query parameter with empty brackets (#1501)
* Update tests for changed werkzeug behavior in 2.1 (#1506)
https://github.com/pallets/werkzeug/issues/2352
* Bugfix/async security check (#1512)
* Add failing tests
* Use for else construct
* openapi: remove JSON body second validation and type casting (#1170)
* openapi: remove body preprocessing
Body is already validated using jsonschema. There was also some type
casting but it was wrong: e.g. not recurring deeply into dicts and lists,
relying on existence of "type" in schema (which is not there e.g. if
oneOf is used). Anyway, the only reason why types should be casted is
converting integer values to float if the type is number. But this is in
most cases irrelevant.
Added an example, which did not work before this commit (echoed `{}`)
e.g. for
```
curl localhost:8080/api/foo -H 'content-type: application/json' -d
'{"foo": 1}'
```
but now the example works (echoes `{"foo": 1}`).
* test with oneOf in the requestBody
* remove oneof examples: superseded by tests
Co-authored-by: Pavol Vargovcik <pavol.vargovcik@kiwi.com>
Co-authored-by: Ruwann <ruwanlambrichts@gmail.com>
Co-authored-by: Pavol Vargovčík <pavol.vargovcik@gmail.com>
Co-authored-by: Pavol Vargovcik <pavol.vargovcik@kiwi.com>
* WIP: rework required_scopes checking
* Update tests for security scopes
* Add test for oauth security scheme with multiple possible scopes
* Update security tests
* Change optional auth test to correct behaviour
* Update security documentation
* Remove TODOs
* Catch possible exceptions from failed checks in async security factory
* Add .venv/ to gitignore
* Try to raise most specific exception
* Add test for raising most specific error
* Update async security handler factory
* Fix security handler error catching
* Fix imports order