From a40a25202ad460bffaed92937c18e0be01db72ad Mon Sep 17 00:00:00 2001 From: Artur Maciag Date: Fri, 3 Nov 2017 14:59:01 +0000 Subject: [PATCH] Validation shortcurs README updated --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index 4382442..62111de 100644 --- a/README.rst +++ b/README.rst @@ -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