From 6024c3fd940d399e5b2f5a68348d115176125b9e Mon Sep 17 00:00:00 2001 From: Purushothaman Kumaravel Date: Sun, 3 May 2026 17:05:25 +0530 Subject: [PATCH] fix: replace Type[] with type[] to match upstream imports Upstream removed 'Type' from typing imports in favor of builtin type[]. The custom route_class/router_class parameters still used Type[], causing NameError across all tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- fastapi/applications.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastapi/applications.py b/fastapi/applications.py index c77b70c6db..6cc1f5524b 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -811,7 +811,7 @@ class FastAPI(Starlette): ), ] = True, route_class: Annotated[ - Type[routing.APIRoute], + type[routing.APIRoute], Doc( """ Custom route (*path operation*) class to be used by this router. @@ -822,7 +822,7 @@ class FastAPI(Starlette): ), ] = routing.APIRoute, router_class: Annotated[ - Type[routing.APIRouter], + type[routing.APIRouter], Doc( """ Custom router class to be used by this application.