From 10b5cb11bc2c537f9091c81348829fec76ff9f67 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 19:56:22 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/applications.py | 6 +++--- fastapi/routing.py | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/fastapi/applications.py b/fastapi/applications.py index 4e42ddd88..a2fe8b349 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -1053,11 +1053,11 @@ class FastAPI(Starlette): scope["root_path"] = self.root_path await super().__call__(scope, receive, send) - - def mount(self, path: str, app: ASGIApp, name: str | None = None) -> None: # pragma: no cover + def mount( + self, path: str, app: ASGIApp, name: str | None = None + ) -> None: # pragma: no cover self.router._mount(path, app=app, name=name) # pragma: no cover - def add_api_route( self, path: str, diff --git a/fastapi/routing.py b/fastapi/routing.py index 33019313c..cfd569cb0 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -860,19 +860,20 @@ class APIRouter(routing.Router): self.default_response_class = default_response_class self.generate_unique_id_function = generate_unique_id_function - @deprecated( "Mounting sub-application on router is not supported. " - "Use the `mount` method of FastAPI instance instead.") + "Use the `mount` method of FastAPI instance instead." + ) def mount(self, *args, **kwargs) -> None: # pragma: no cover raise NotImplementedError( "APIRouter does not support mounting other ASGI applications." ) - def _mount(self, path: str, app: ASGIApp, name: str | None = None) -> None: # pragma: no cover + def _mount( + self, path: str, app: ASGIApp, name: str | None = None + ) -> None: # pragma: no cover super().mount(path=path, app=app, name=name) - def route( self, path: str,