Skip to content

Commit d4306d2

Browse files
committed
Requeest wrappers README updated
1 parent 6f1e45e commit d4306d2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ Now you can use it to validate and unmarshal requests
6666
# get body
6767
body = result.body
6868
69+
Request object should implement BaseOpenAPIRequest interface. You can use FlaskOpenAPIRequest a Flask/Werkzeug request wrapper implementation:
70+
71+
.. code-block:: python
72+
73+
from openapi_core.validators import RequestValidator
74+
from openapi_core.wrappers import FlaskOpenAPIRequest
75+
76+
openapi_request = FlaskOpenAPIRequest(flask_request)
77+
validator = RequestValidator(spec)
78+
result = validator.validate(openapi_request)
79+
6980
Related projects
7081
================
7182
* `openapi-spec-validator <https://github.com/p1c2u/openapi-spec-validator>`__

0 commit comments

Comments
 (0)