From 7fcbeb7e232265fd7f18ba08aed6aa1b6af157cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 3 Nov 2025 12:47:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20docs=20for=20advanced?= =?UTF-8?q?=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/advanced/advanced-dependencies.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/advanced/advanced-dependencies.md b/docs/en/docs/advanced/advanced-dependencies.md index fe4852791..5d6a40f46 100644 --- a/docs/en/docs/advanced/advanced-dependencies.md +++ b/docs/en/docs/advanced/advanced-dependencies.md @@ -78,7 +78,9 @@ Dependencies with `yield` have evolved over time to account for the different us ### Dependencies with `yield` and `scope` { #dependencies-with-yield-and-scope } -In FastAPI 0.121.0 there was added support for `Depends(scope="function")` for dependencies with `yield`, using this, the exit code after `yield` is executed right after the *path operation function* is finished, before the response is sent back to the client. +In version 0.121.0, FastAPI added support for `Depends(scope="function")` for dependencies with `yield`. + +Using `Depends(scope="function")`, the exit code after `yield` is executed right after the *path operation function* is finished, before the response is sent back to the client. And when using `Depends(scope="request")` (the default), the exit code after `yield` is executed after the response is sent.