From 1fdb6236d4689d974ac3de976753f24d1ac4996c Mon Sep 17 00:00:00 2001 From: svlandeg Date: Tue, 10 Mar 2026 20:44:15 +0100 Subject: [PATCH] fix ignore --- fastapi/applications.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fastapi/applications.py b/fastapi/applications.py index e702a494e9..c4fbfc4ca3 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -1006,11 +1006,10 @@ class FastAPI(Starlette): self.exception_handlers.setdefault( RequestValidationError, request_validation_exception_handler ) - self.exception_handlers.setdefault( - WebSocketRequestValidationError, - # Starlette still has incorrect type specification for the handlers - websocket_request_validation_exception_handler, # type: ignore # ty: ignore[unused-ignore-comment] - ) + + # Starlette still has incorrect type specification for the handlers + self.exception_handlers.setdefault(WebSocketRequestValidationError, websocket_request_validation_exception_handler) # type: ignore + self.user_middleware: list[Middleware] = ( [] if middleware is None else list(middleware)