From c2f9db2c0362fce85aa88b54540f267a96487976 Mon Sep 17 00:00:00 2001 From: ordinary-jamie Date: Wed, 13 Sep 2023 07:28:22 +1000 Subject: [PATCH] Fix typing for FastAPI add api route Make typing of endpoint parameter consistent with downstream calls and other utilities. --- fastapi/applications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/applications.py b/fastapi/applications.py index 5cc5682924909..d7212ab9f5372 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -294,7 +294,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: def add_api_route( self, path: str, - endpoint: Callable[..., Coroutine[Any, Any, Response]], + endpoint: Callable[..., Any], *, response_model: Any = Default(None), status_code: Optional[int] = None,