From: Sebastián Ramírez Date: Thu, 1 Sep 2022 09:05:41 +0000 (+0200) Subject: 📝 Add tip about using alias for form data fields (#5329) X-Git-Tag: 0.82.0~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=adf4e77dd6e939db7afc895ad318e0452fb9ea51;p=thirdparty%2Ffastapi%2Ffastapi.git 📝 Add tip about using alias for form data fields (#5329) --- diff --git a/docs/en/docs/tutorial/request-forms.md b/docs/en/docs/tutorial/request-forms.md index 2021a098f9..26922685a6 100644 --- a/docs/en/docs/tutorial/request-forms.md +++ b/docs/en/docs/tutorial/request-forms.md @@ -27,7 +27,7 @@ For example, in one of the ways the OAuth2 specification can be used (called "pa The spec requires the fields to be exactly named `username` and `password`, and to be sent as form fields, not JSON. -With `Form` you can declare the same metadata and validation as with `Body` (and `Query`, `Path`, `Cookie`). +With `Form` you can declare the same configurations as with `Body` (and `Query`, `Path`, `Cookie`), including validation, examples, an alias (e.g. `user-name` instead of `username`), etc. !!! info `Form` is a class that inherits directly from `Body`.