Refactor routing internals into modular components with stable facade by rajratangm · Pull Request #15210 · fastapi/fastapi

and others added 2 commits

March 24, 2026 16:56
Extract APIRouter, APIRoute/APIWebSocketRoute, and handler/util logic into focused modules while preserving `fastapi.routing` public imports via compatibility re-exports and adding routing facade contract tests.

Made-with: Cursor
Exercise IntEnum status normalization and Response return-annotation inference to keep routing refactor coverage at required threshold.

Made-with: Cursor

@pre-commit-ci-lite

Normalize request handler typing in routing utils and explicitly type APIRoute.response_field to satisfy mypy and ty hooks.

Made-with: Cursor
Cover both sync and async wrapper paths in request_response to keep aggregate coverage at the repository fail-under threshold.

Made-with: Cursor
Exercise get_request_handler legacy dependant signature and execute raw response helper to close remaining uncovered lines seen in coverage-combine.

Made-with: Cursor
Use an existing top-level endpoint callable for legacy get_request_handler path coverage so coverage-combine can reach 100%.

Made-with: Cursor