diff --git a/fastapi/applications.py b/fastapi/applications.py index c4fbfc4ca3..c468d58cc2 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -1008,8 +1008,10 @@ class FastAPI(Starlette): ) # Starlette still has incorrect type specification for the handlers - self.exception_handlers.setdefault(WebSocketRequestValidationError, websocket_request_validation_exception_handler) # type: ignore - + self.exception_handlers.setdefault( + WebSocketRequestValidationError, + websocket_request_validation_exception_handler, + ) # type: ignore self.user_middleware: list[Middleware] = ( [] if middleware is None else list(middleware)