📝 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

+3 -1
View File
@@ -18,9 +18,11 @@ The first value is the default value, you can pass all the extra validation or a
{!./src/cookie_params/tutorial001.py!}
```
!!! info
!!! note "Technical Details"
`Cookie` is a "sister" class of `Path` and `Query`. It also inherits from the same common `Param` class.
But remember that when you import `Query`, `Path`, `Cookie` 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>.
!!! info
To declare cookies, you need to use `Cookie`, because otherwise the parameters would be interpreted as query parameters.