Skip to content

Commit

Permalink
📝 Add OpenAPI warning to "Body - Fields" docs with extra schema exten…
Browse files Browse the repository at this point in the history
…sions (#4846)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
  • Loading branch information
ml-evs and tiangolo committed May 11, 2022
1 parent 1bbbdb4 commit 4fcdb31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/en/docs/tutorial/body-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4fcdb31

Please sign in to comment.