Browse Source

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 <[email protected]>
pull/13483/head
Purushothaman Kumaravel 2 months ago
parent
commit
6024c3fd94
  1. 4
      fastapi/applications.py

4
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.

Loading…
Cancel
Save