From 367b272a6096bc546eefbd0408ba27b399343f70 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Tue, 25 Nov 2025 22:01:16 +0100 Subject: [PATCH] Fix `scopes` deprecation message and `Security` docstring --- fastapi/param_functions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fastapi/param_functions.py b/fastapi/param_functions.py index eae6f0ae3..7c48ec15d 100644 --- a/fastapi/param_functions.py +++ b/fastapi/param_functions.py @@ -2396,6 +2396,8 @@ def Security( # noqa: N802 ```python Security(dependency_fn, oauth_scopes=["items", "users"]) ``` + + ​ """ ), ] = None, @@ -2438,8 +2440,8 @@ def Security( # noqa: N802 Declare a FastAPI Security dependency. The only difference with a regular dependency is that it can declare OAuth2 - scopes that will be integrated with OpenAPI and the automatic UI docs (by default - at `/docs`). + scopes (`oauth_scopes` parameter) that will be integrated with OpenAPI and the + automatic UI docs (by default at `/docs`). It takes a single "dependable" callable (like a function).