diff --git a/fastapi/applications.py b/fastapi/applications.py index 19a2014efa..4af1146b0d 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -1006,8 +1006,8 @@ class FastAPI(Starlette): # Starlette still has incorrect type specification for the handlers self.exception_handlers.setdefault( WebSocketRequestValidationError, - websocket_request_validation_exception_handler, # type: ignore # ty: ignore[unused-ignore-comment] - ) # ty: ignore + websocket_request_validation_exception_handler, # type: ignore[arg-type] # ty: ignore[unused-ignore-comment] + ) # ty: ignore[no-matching-overload] self.user_middleware: list[Middleware] = ( [] if middleware is None else list(middleware)