📝 Add docs about params as functions for mypy (#231)

This commit is contained in:
Sebastián Ramírez authored and GitHub committed 2019-05-15 22:01:23 +04:00
1 parent ca27317b65
commit d240421378
7 files changed
+29 -7

No files matched your search

+2
View File
@@ -108,6 +108,8 @@ In this case, it requires the scope `me` (it could require more than one scope).
But by using `Security` instead of `Depends`, **FastAPI** will know that it can declare security scopes, use them internally, and document the API with OpenAPI.
But when you import `Query`, `Path`, `Depends`, `Security` and others from `fastapi`, <a href="https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#recap" target="_blank">those are actually functions that return classes of the same name</a>.
## Use `SecurityScopes`
Now update the dependency `get_current_user`.