diff --git a/integration_tests/base_routes.py b/integration_tests/base_routes.py index a271fb26..06898ddf 100644 --- a/integration_tests/base_routes.py +++ b/integration_tests/base_routes.py @@ -1,7 +1,7 @@ import os import pathlib from collections import defaultdict -from typing import Optional +from typing import Optional, List from integration_tests.subroutes import di_subrouter, sub_router from integration_tests.views import AsyncView, SyncView @@ -559,6 +559,10 @@ async def async_dict_post(): # Body +class TestMyRequest(Body): + items: List[str] + numbers: list[int] + @app.post("/sync/body") def sync_body_post(request: Request): @@ -574,6 +578,11 @@ async def async_body_post(request: Request): def sync_form_data(request: Request): return request.headers["Content-Type"] +@app.post("/sync/body/typed") +def sync_body_typed(body: TestMyRequest): + # the server should just start + return "This is not tested with a request" + # JSON Request