mirror of
https://github.com/correl/openapi-core.git
synced 2024-12-29 11:09:25 +00:00
Validation shortcurs README updated
This commit is contained in:
parent
78afae3104
commit
a40a25202a
1 changed files with 9 additions and 0 deletions
|
@ -72,6 +72,15 @@ and unmarshal request data from validation result
|
|||
# get body
|
||||
validated_body = result.body
|
||||
|
||||
or use shortcuts for simple validation
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from openapi_core import validate_parameters, validate_body
|
||||
|
||||
validated_params = validate_parameters(spec, request)
|
||||
validated_body = validate_body(spec, request)
|
||||
|
||||
Request object should implement BaseOpenAPIRequest interface. You can use FlaskOpenAPIRequest a Flask/Werkzeug request wrapper implementation:
|
||||
|
||||
.. code-block:: python
|
||||
|
|
Loading…
Reference in a new issue