Fix `scopes` deprecation message and `Security` docstring

This commit is contained in:
Yurii Motov 2025-11-25 22:01:16 +01:00
parent f42161cd19
commit 367b272a60
1 changed files with 4 additions and 2 deletions

View File

@ -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).