Browse Source

📝 Add OpenAPI warning to "Body - Fields" docs with extra schema extensions (#4846)

Co-authored-by: Sebastián Ramírez <[email protected]>
pull/4887/head
Matthew Evans 3 years ago
committed by GitHub
parent
commit
4fcdb31947
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs/en/docs/tutorial/body-fields.md

4
docs/en/docs/tutorial/body-fields.md

@ -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. 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 ## Recap
You can use Pydantic's `Field` to declare extra validations and metadata for model attributes. You can use Pydantic's `Field` to declare extra validations and metadata for model attributes.

Loading…
Cancel
Save