Skip to content

Commit 443a502

Browse files
committed
docs integrations aiohttp formatting fix
1 parent 5d6a246 commit 443a502

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

docs/integrations.rst

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@ Integrations
33

44
Openapi-core integrates with your popular libraries and frameworks. Each integration offers different levels of integration that help validate and unmarshal your request and response data.
55

6+
aiohttp.web
7+
-----------
8+
9+
This section describes integration with `aiohttp.web <https://docs.aiohttp.org/en/stable/web.html>`__ framework.
10+
11+
Low level
12+
~~~~~~~~~
13+
14+
You can use ``AIOHTTPOpenAPIWebRequest`` as an aiohttp request factory:
15+
16+
.. code-block:: python
17+
18+
from openapi_core import unmarshal_request
19+
from openapi_core.contrib.aiohttp import AIOHTTPOpenAPIWebRequest
20+
21+
request_body = await aiohttp_request.text()
22+
openapi_request = AIOHTTPOpenAPIWebRequest(aiohttp_request, body=request_body)
23+
result = unmarshal_request(openapi_request, spec=spec)
24+
25+
You can use ``AIOHTTPOpenAPIWebRequest`` as an aiohttp response factory:
26+
27+
.. code-block:: python
28+
29+
from openapi_core import unmarshal_response
30+
from openapi_core.contrib.starlette import AIOHTTPOpenAPIWebRequest
31+
32+
openapi_response = StarletteOpenAPIResponse(aiohttp_response)
33+
result = unmarshal_response(openapi_request, openapi_response, spec=spec)
34+
35+
636
Bottle
737
------
838

@@ -336,33 +366,3 @@ You can use ``WerkzeugOpenAPIResponse`` as a Werkzeug response factory:
336366
337367
openapi_response = WerkzeugOpenAPIResponse(werkzeug_response)
338368
result = unmarshal_response(openapi_request, openapi_response, spec=spec)
339-
340-
341-
aiohttp.web
342-
---------
343-
344-
This section describes integration with `aiohttp.web <https://docs.aiohttp.org/en/stable/web.html>`__ framework.
345-
346-
Low level
347-
~~~~~~~~~
348-
349-
You can use ``AIOHTTPOpenAPIWebRequest`` as an aiohttp request factory:
350-
351-
.. code-block:: python
352-
353-
from openapi_core import unmarshal_request
354-
from openapi_core.contrib.aiohttp import AIOHTTPOpenAPIWebRequest
355-
356-
request_body = await aiohttp_request.text()
357-
openapi_request = AIOHTTPOpenAPIWebRequest(aiohttp_request, body=request_body)
358-
result = unmarshal_request(openapi_request, spec=spec)
359-
360-
You can use ``AIOHTTPOpenAPIWebRequest`` as an aiohttp response factory:
361-
362-
.. code-block:: python
363-
364-
from openapi_core import unmarshal_response
365-
from openapi_core.contrib.starlette import AIOHTTPOpenAPIWebRequest
366-
367-
openapi_response = StarletteOpenAPIResponse(aiohttp_response)
368-
result = unmarshal_response(openapi_request, openapi_response, spec=spec)

0 commit comments

Comments
 (0)