From 5e2896fd3c0b0aa880a9daec873c02e595da18b7 Mon Sep 17 00:00:00 2001 From: Joao-Pedro-P-Holanda Date: Fri, 14 Feb 2025 15:00:13 -0300 Subject: [PATCH] docs: documenting edge case in Security's scopes parameter adding a short information about the case where a string is given in place of a list of strings (or similar) on the Doc of the Security function in fastapi/param_functions.py --- fastapi/param_functions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastapi/param_functions.py b/fastapi/param_functions.py index b3621626c..e44ce4f70 100644 --- a/fastapi/param_functions.py +++ b/fastapi/param_functions.py @@ -2295,7 +2295,8 @@ def Security( # noqa: N802 Doc( """ OAuth2 scopes required for the *path operation* that uses this Security - dependency. + dependency. If a string is given, the list of scopes will have only one scope + defined by the string value. The term "scope" comes from the OAuth2 specification, it seems to be intentionally vague and interpretable. It normally refers to permissions,