Commit Graph

7 Commits

Author SHA1 Message Date
Robbe Sneyders
1ab5400c0b Move JSON response body validation to middleware (#1591)
* 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
2022-10-03 23:01:21 +02:00
Robbe Sneyders
600ed4ed94 Format files with black 2022-06-25 23:50:52 +02:00
Robbe Sneyders
cff1705c0a Add test for MethodViewResolver (#1559)
* Add test for MethodViewResolver

* Warn about ignoring of collection_endpoint_name in MethodViewResolver

* Add docstring on class_arguments in MethodViewResolver
2022-06-25 10:55:32 +02:00
Nico Braun
3c6e13c1c1 call as_view in methodresolver (#1552)
* call as_view in methodresolver

Signed-off-by: Nico Braun <rainbowstack@gmail.com>

* allow to use deprecated method view resolver

Signed-off-by: Nico Braun <rainbowstack@gmail.com>

* update method view example

Signed-off-by: Nico Braun <rainbowstack@gmail.com>

* update method view docs

Signed-off-by: Nico Braun <rainbowstack@gmail.com>

* fix pre-commit issues

Signed-off-by: Nico Braun <rainbowstack@gmail.com>
2022-06-24 17:55:11 +02:00
Robbe Sneyders
e0183d3485 Clean up operation classes (#1535) 2022-05-13 15:04:51 +02:00
James Kent
40d9dad984 [FIX] MethodViewResolver CamelCase Methods (#1467)
* ensure view_name is CamelCase

* update tests for MethodViewResolver for CamelCase

* use inflection package to camelize

Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
2022-02-22 19:34:16 +01:00
Simon
92867452a2 Added MethodViewResolver (#847)
* Added MethodViewResolver

By subclassing RestyResolver and modifying its `resolve_function_from_operation_id` method, it is now possible to use automatic routing functionality with Flask's MethodView together with MethodViewResolver.

* Add MethodView example

* Add tests for methodview

* add documentation on how to use MethodViewResolver
2019-02-04 08:25:27 +01:00