From d70de472f653a94e74d222bb0a8a6112a9d47d59 Mon Sep 17 00:00:00 2001 From: Jan Vollmer Date: Tue, 14 Jan 2025 21:44:03 +0100 Subject: [PATCH] improve formatting for and re-word doc string --- fastapi/routing.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 9d335ad10..af597cada 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -868,10 +868,13 @@ class APIRouter(routing.Router): ] = Default(generate_unique_id), defer_init: Annotated[ bool, - Doc(""" - By default every route will defer its initialization upon usage. - This flag disables the behavior for the routes defined in this router, causing the routes to initialize immediately. - """), + Doc( + """ + By default, every route will defer its initialization until the first call. + This flag can be used to deactivate this behavior for the routes defined in this router, + causing the routes to initialize immediately when they are defined. + """ + ), ] = True, ) -> None: super().__init__(