mirror of https://github.com/tiangolo/fastapi.git
📝 Add OpenAPI warning to "Body - Fields" docs with extra schema extensions (#4846)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
1bbbdb4b7f
commit
4fcdb31947
|
|
@ -57,6 +57,10 @@ You can declare extra information in `Field`, `Query`, `Body`, etc. And it will
|
|||
|
||||
You will learn more about adding extra information later in the docs, when learning to declare examples.
|
||||
|
||||
!!! warning
|
||||
Extra keys passed to `Field` will also be present in the resulting OpenAPI schema for your application.
|
||||
As these keys may not necessarily be part of the OpenAPI specification, some OpenAPI tools, for example [the OpenAPI validator](https://validator.swagger.io/), may not work with your generated schema.
|
||||
|
||||
## Recap
|
||||
|
||||
You can use Pydantic's `Field` to declare extra validations and metadata for model attributes.
|
||||
|
|
|
|||
Loading…
Reference in New Issue