Browse Source

chore: adding type hint for scopes string case

adding Sequence[str] type hint on the self.scopes declaration when
scopes is a string in Security
pull/13369/head
Joao-Pedro-P-Holanda 3 months ago
parent
commit
c25d62ff4b
  1. 2
      fastapi/params.py

2
fastapi/params.py

@ -784,6 +784,6 @@ class Security(Depends):
): ):
super().__init__(dependency=dependency, use_cache=use_cache) super().__init__(dependency=dependency, use_cache=use_cache)
if isinstance(scopes, str): if isinstance(scopes, str):
self.scopes = [scopes] self.scopes: Sequence[str] = [scopes]
else: else:
self.scopes = scopes or [] self.scopes = scopes or []

Loading…
Cancel
Save