]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Add OpenAPI warning to "Body - Fields" docs with extra schema extensions (#4846)
authorMatthew Evans <7916000+ml-evs@users.noreply.github.com>
Wed, 11 May 2022 21:43:47 +0000 (22:43 +0100)
committerGitHub <noreply@github.com>
Wed, 11 May 2022 21:43:47 +0000 (16:43 -0500)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs/en/docs/tutorial/body-fields.md

index 1f38a0c5c566fa6f332e5ddc0c861765ce872c85..0cfe576d68d72abe2180fb75d74fbf94ab081276 100644 (file)
@@ -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.