📝 Add note in response model docs: why not return type annotations (#109)

* Update response model documentation to explain design choice

Closes #101

* 📝 Update note about return function type annotation
This commit is contained in:
James Saunders 2019-03-29 17:02:53 +02:00 committed by Sebastián Ramírez
parent 3d4f59f35a
commit 714e68b5f0
1 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,9 @@ But most importantly:
* Will limit the output data to that of the model. We'll see how that's important below.
!!! note "Technical Details"
The response model is declared in this parameter instead of as a function return type annotation, because the path function may not actually return that response model but rather return a `dict`, database object or some other model, and then use the `response_model` to perform the field limiting and serialization.
## Return the same input data
Here we are declaring a `UserIn` model, it will contain a plaintext password: