]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
Fix redirect docs.pydantic.dev
authorYurii Motov <yurii.motov.monte@gmail.com>
Fri, 10 Jul 2026 15:57:44 +0000 (17:57 +0200)
committerYurii Motov <yurii.motov.monte@gmail.com>
Fri, 10 Jul 2026 16:13:09 +0000 (18:13 +0200)
19 files changed:
README.md
docs/en/docs/advanced/dataclasses.md
docs/en/docs/advanced/openapi-callbacks.md
docs/en/docs/advanced/settings.md
docs/en/docs/alternatives.md
docs/en/docs/features.md
docs/en/docs/history-design-future.md
docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
docs/en/docs/index.md
docs/en/docs/project-generation.md
docs/en/docs/python-types.md
docs/en/docs/release-notes.md
docs/en/docs/tutorial/body-nested-models.md
docs/en/docs/tutorial/body.md
docs/en/docs/tutorial/extra-data-types.md
docs/en/docs/tutorial/extra-models.md
docs/en/docs/tutorial/path-params.md
docs/en/docs/tutorial/query-params-str-validations.md
docs/en/docs/tutorial/schema-extra-example.md

index 5367cd3a1a8a9a0e4c11c785cb25f3edabf586a8..61b7b96283736697bc633545048ef14b796c48ee 100644 (file)
--- a/README.md
+++ b/README.md
@@ -130,7 +130,7 @@ If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be
 FastAPI stands on the shoulders of giants:
 
 * [Starlette](https://starlette.dev/) for the web parts.
-* [Pydantic](https://docs.pydantic.dev/) for the data parts.
+* [Pydantic](https://pydantic.dev/docs/) for the data parts.
 
 ## Installation
 
@@ -526,7 +526,7 @@ There are some additional dependencies you might want to install.
 
 Additional optional Pydantic dependencies:
 
-* [`pydantic-settings`](https://docs.pydantic.dev/latest/usage/pydantic_settings/) - for settings management.
+* [`pydantic-settings`](https://pydantic.dev/docs/validation/latest/concepts/pydantic_settings/) - for settings management.
 * [`pydantic-extra-types`](https://github.com/pydantic/pydantic-extra-types) - for extra types to be used with Pydantic.
 
 Additional optional FastAPI dependencies:
index 469eff65bf6c35a5e59434b9daca8cf76cc13376..1fee4245405d7a926f39135931526d9bf4973e34 100644 (file)
@@ -88,7 +88,7 @@ Check the in-code annotation tips above to see more specific details.
 
 You can also combine `dataclasses` with other Pydantic models, inherit from them, include them in your own models, etc.
 
-To learn more, check the [Pydantic docs about dataclasses](https://docs.pydantic.dev/latest/concepts/dataclasses/).
+To learn more, check the [Pydantic docs about dataclasses](https://pydantic.dev/docs/validation/latest/concepts/dataclasses/).
 
 ## Version { #version }
 
index 17910e1cfcb051bd77cf6b1f24fedcc523bd8c0f..d8c384ad8d95407a5f10fb81c185bf1b69e1ac4d 100644 (file)
@@ -35,7 +35,7 @@ This part is pretty normal, most of the code is probably already familiar to you
 
 /// tip
 
-The `callback_url` query parameter uses a Pydantic [Url](https://docs.pydantic.dev/latest/api/networks/) type.
+The `callback_url` query parameter uses a Pydantic [Url](https://pydantic.dev/docs/validation/latest/api/pydantic/networks/) type.
 
 ///
 
index ff313f0881eb9f6721e9b4cb704c964b75ea9240..b864f3d33754a30576b91beb8beef21c6059b22e 100644 (file)
@@ -20,7 +20,7 @@ That means that any value read in Python from an environment variable will be a
 
 ## Pydantic `Settings` { #pydantic-settings }
 
-Fortunately, Pydantic provides a great utility to handle these settings coming from environment variables with [Pydantic: Settings management](https://docs.pydantic.dev/latest/concepts/pydantic_settings/).
+Fortunately, Pydantic provides a great utility to handle these settings coming from environment variables with [Pydantic: Settings management](https://pydantic.dev/docs/validation/latest/concepts/pydantic_settings/).
 
 ### Install `pydantic-settings` { #install-pydantic-settings }
 
@@ -172,7 +172,7 @@ But a dotenv file doesn't really have to have that exact filename.
 
 ///
 
-Pydantic has support for reading from these types of files using an external library. You can read more at [Pydantic Settings: Dotenv (.env) support](https://docs.pydantic.dev/latest/concepts/pydantic_settings/#dotenv-env-support).
+Pydantic has support for reading from these types of files using an external library. You can read more at [Pydantic Settings: Dotenv (.env) support](https://pydantic.dev/docs/validation/latest/concepts/pydantic_settings/#dotenv-env-support).
 
 /// tip
 
@@ -197,7 +197,7 @@ And then update your `config.py` with:
 
 /// tip
 
-The `model_config` attribute is used just for Pydantic configuration. You can read more at [Pydantic: Concepts: Configuration](https://docs.pydantic.dev/latest/concepts/config/).
+The `model_config` attribute is used just for Pydantic configuration. You can read more at [Pydantic: Concepts: Configuration](https://pydantic.dev/docs/validation/latest/concepts/config/).
 
 ///
 
index adb2f67808beab62285329b14f3f238b442eb703..2aa4e48b92f19f8a1526f8d8c89194a3dd909e52 100644 (file)
@@ -401,7 +401,7 @@ I consider **FastAPI** a "spiritual successor" to APIStar, while improving and i
 
 ## Used by **FastAPI** { #used-by-fastapi }
 
-### [Pydantic](https://docs.pydantic.dev/) { #pydantic }
+### [Pydantic](https://pydantic.dev/docs/) { #pydantic }
 
 Pydantic is a library to define data validation, serialization and documentation (using JSON Schema) based on Python type hints.
 
index 2be4eeee6fbbe71caf24d9e364d3ad9409d6acae..42ddf60069d545f33bcdecf65de5d0b7608812ae 100644 (file)
@@ -177,7 +177,7 @@ With **FastAPI** you get all of **Starlette**'s features (as FastAPI is just Sta
 
 ## Pydantic features { #pydantic-features }
 
-**FastAPI** is fully compatible with (and based on) [**Pydantic**](https://docs.pydantic.dev/). So, any additional Pydantic code you have, will also work.
+**FastAPI** is fully compatible with (and based on) [**Pydantic**](https://pydantic.dev/docs/). So, any additional Pydantic code you have, will also work.
 
 Including external libraries also based on Pydantic, such as <abbr title="Object-Relational Mapper">ORM</abbr>s and <abbr title="Object-Document Mapper">ODM</abbr>s for databases.
 
index d3dedee67c52adc57b44c30b9b91fe7b207b5a6c..6779548d4f43828c3c982b146bd6a291e6ec85f0 100644 (file)
@@ -54,7 +54,7 @@ All in a way that provided the best development experience for all the developer
 
 ## Requirements { #requirements }
 
-After testing several alternatives, I decided that I was going to use [**Pydantic**](https://docs.pydantic.dev/) for its advantages.
+After testing several alternatives, I decided that I was going to use [**Pydantic**](https://pydantic.dev/docs/) for its advantages.
 
 Then I contributed to it, to make it fully compliant with JSON Schema, to support different ways to define constraint declarations, and to improve editor support (type checks, autocompletion) based on the tests in several editors.
 
index 816cf54f543e45062e62eff3ad7b3fce780d586b..7b19dddb2381fab2828eabc5665e90d3adaae645 100644 (file)
@@ -24,7 +24,7 @@ If you have an old FastAPI app with Pydantic v1, here I'll show you how to migra
 
 ## Official Guide { #official-guide }
 
-Pydantic has an official [Migration Guide](https://docs.pydantic.dev/latest/migration/) from v1 to v2.
+Pydantic has an official [Migration Guide](https://pydantic.dev/docs/validation/latest/get-started/migration/) from v1 to v2.
 
 It also includes what has changed, how validations are now more correct and strict, possible caveats, etc.
 
index 9b008a596994c97cf40931ffb010cefdb9583777..92bdfe319d69c6ae0c14999f58b22c478ac2c6f0 100644 (file)
@@ -176,7 +176,7 @@ If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be
 FastAPI stands on the shoulders of giants:
 
 * [Starlette](https://starlette.dev/) for the web parts.
-* [Pydantic](https://docs.pydantic.dev/) for the data parts.
+* [Pydantic](https://pydantic.dev/docs/) for the data parts.
 
 ## Installation { #installation }
 
@@ -572,7 +572,7 @@ There are some additional dependencies you might want to install.
 
 Additional optional Pydantic dependencies:
 
-* [`pydantic-settings`](https://docs.pydantic.dev/latest/usage/pydantic_settings/) - for settings management.
+* [`pydantic-settings`](https://pydantic.dev/docs/validation/latest/concepts/pydantic_settings/) - for settings management.
 * [`pydantic-extra-types`](https://github.com/pydantic/pydantic-extra-types) - for extra types to be used with Pydantic.
 
 Additional optional FastAPI dependencies:
index ab6e87527b6d4aca9e80ee2be254c056c045e1f0..a0527bbb180c52521455adbbbbc25d65eb5af164 100644 (file)
@@ -10,7 +10,7 @@ GitHub Repository: [Full Stack FastAPI Template](https://github.com/tiangolo/ful
 
 - ⚡ [**FastAPI**](https://fastapi.tiangolo.com) for the Python backend API.
   - 🧰 [SQLModel](https://sqlmodel.tiangolo.com) for the Python SQL database interactions (ORM).
-  - 🔍 [Pydantic](https://docs.pydantic.dev), used by FastAPI, for the data validation and settings management.
+  - 🔍 [Pydantic](https://pydantic.dev/docs/), used by FastAPI, for the data validation and settings management.
   - 💾 [PostgreSQL](https://www.postgresql.org) as the SQL database.
 - 🚀 [React](https://react.dev) for the frontend.
   - 💃 Using TypeScript, hooks, Vite, and other parts of a modern frontend stack.
index c8d9bf41c9ee02763a57b42474b4cdca5a07bcda..d54faac9b48e6d2a38dfcdfde306cf8cb0e9a4df 100644 (file)
@@ -269,7 +269,7 @@ It doesn't mean "`one_person` is the **class** called `Person`".
 
 ## Pydantic models { #pydantic-models }
 
-[Pydantic](https://docs.pydantic.dev/) is a Python library to perform data validation.
+[Pydantic](https://pydantic.dev/docs/) is a Python library to perform data validation.
 
 You declare the "shape" of the data as classes with attributes.
 
@@ -285,7 +285,7 @@ An example from the official Pydantic docs:
 
 /// note
 
-To learn more about [Pydantic, check its docs](https://docs.pydantic.dev/).
+To learn more about [Pydantic, check its docs](https://pydantic.dev/docs/).
 
 ///
 
index ebd74f487443068c1b8cfce078668316ec9065d6..8e35f163cb03dba9cb4fdfda6e8503fe7378c32f 100644 (file)
@@ -4046,7 +4046,7 @@ There are **tests for both Pydantic v1 and v2**, and test **coverage** is kept a
 * The attribute `schema_extra` for the internal class `Config` has been replaced by the key `json_schema_extra` in the new `model_config` dict.
     * You can read more about it in the docs for [Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/).
 * When you install `"fastapi[all]"` it now also includes:
-    * [`pydantic-settings`](https://docs.pydantic.dev/latest/usage/pydantic_settings/) - for settings management.
+    * [`pydantic-settings`](https://pydantic.dev/docs/validation/latest/concepts/pydantic_settings/) - for settings management.
     * [`pydantic-extra-types`](https://docs.pydantic.dev/latest/usage/types/extra_types/extra_types/) - for extra types to be used with Pydantic.
 * Now Pydantic Settings is an additional optional package (included in `"fastapi[all]"`). To use settings you should now import `from pydantic_settings import BaseSettings` instead of importing from `pydantic` directly.
     * You can read more about it in the docs for [Settings and Environment Variables](https://fastapi.tiangolo.com/advanced/settings/).
index 61ed93202203fdc47f20cfde7308479c91aaf11a..b7c17c7cd91bf09e6d2391756eb343a8e28c4294 100644 (file)
@@ -96,7 +96,7 @@ Again, doing just that declaration, with **FastAPI** you get:
 
 Apart from normal singular types like `str`, `int`, `float`, etc. you can use more complex singular types that inherit from `str`.
 
-To see all the options you have, check out [Pydantic's Type Overview](https://docs.pydantic.dev/latest/concepts/types/). You will see some examples in the next chapter.
+To see all the options you have, check out [Pydantic's Type Overview](https://pydantic.dev/docs/validation/latest/concepts/types/). You will see some examples in the next chapter.
 
 For example, as in the `Image` model we have a `url` field, we can declare it to be an instance of Pydantic's `HttpUrl` instead of a `str`:
 
index b074a751dd778fc4eae1be8ec8c4cf30ade24608..0375f49a9d61c9b1217e24abbdbb76ab907ef9e4 100644 (file)
@@ -6,7 +6,7 @@ A **request** body is data sent by the client to your API. A **response** body i
 
 Your API almost always has to send a **response** body. But clients don't necessarily need to send **request bodies** all the time, sometimes they only request a path, maybe with some query parameters, but don't send a body.
 
-To declare a **request** body, you use [Pydantic](https://docs.pydantic.dev/) models with all their power and benefits.
+To declare a **request** body, you use [Pydantic](https://pydantic.dev/docs/) models with all their power and benefits.
 
 /// note
 
index 53dd46c914d255ccbadf9c3cc2d11bcc96bf2f99..e965f298e5a94e7cec7ff143466b8325e9ea56bc 100644 (file)
@@ -36,7 +36,7 @@ Here are some of the additional data types you can use:
 * `datetime.timedelta`:
     * A Python `datetime.timedelta`.
     * In requests and responses will be represented as a `float` of total seconds.
-    * Pydantic also allows representing it as an "ISO 8601 time diff encoding", [see the docs for more info](https://docs.pydantic.dev/latest/concepts/serialization/#custom-serializers).
+    * Pydantic also allows representing it as an "ISO 8601 time diff encoding", [see the docs for more info](https://pydantic.dev/docs/validation/latest/concepts/serialization/#custom-serializers).
 * `frozenset`:
     * In requests and responses, treated the same as a `set`:
         * In requests, a list will be read, eliminating duplicates and converting it to a `set`.
index d2b53cb66fbdb77e0c2f29f3084eba5679dc8e8d..565c74fec5d81f6d0a6512049a2fde712919defe 100644 (file)
@@ -166,7 +166,7 @@ To do that, use the standard Python type hint [`typing.Union`](https://docs.pyth
 
 /// note
 
-When defining a [`Union`](https://docs.pydantic.dev/latest/concepts/types/#unions), include the most specific type first, followed by the less specific type. In the example below, the more specific `PlaneItem` comes before `CarItem` in `Union[PlaneItem, CarItem]`.
+When defining a [`Union`](https://pydantic.dev/docs/validation/latest/concepts/types/#unions), include the most specific type first, followed by the less specific type. In the example below, the more specific `PlaneItem` comes before `CarItem` in `Union[PlaneItem, CarItem]`.
 
 ///
 
index c8fe68f5e4abb5681adb59f8c2ff6d34adc28ff9..3eb92bdc4672cc5b95d60983db01e9c44588860b 100644 (file)
@@ -102,7 +102,7 @@ The same way, there are many compatible tools. Including code generation tools f
 
 ## Pydantic { #pydantic }
 
-All the data validation is performed under the hood by [Pydantic](https://docs.pydantic.dev/), so you get all the benefits from it. And you know you are in good hands.
+All the data validation is performed under the hood by [Pydantic](https://pydantic.dev/docs/), so you get all the benefits from it. And you know you are in good hands.
 
 You can use the same type declarations with `str`, `float`, `bool` and many other complex data types.
 
index eb9fa2607b824f5bb2a949af6fc55ad745e6af19..c4dd508571d6d49c8d1b0127adeb7243d5cc7e38 100644 (file)
@@ -370,11 +370,11 @@ There could be cases where you need to do some **custom validation** that can't
 
 In those cases, you can use a **custom validator function** that is applied after the normal validation (e.g. after validating that the value is a `str`).
 
-You can achieve that using [Pydantic's `AfterValidator`](https://docs.pydantic.dev/latest/concepts/validators/#field-after-validator) inside of `Annotated`.
+You can achieve that using [Pydantic's `AfterValidator`](https://pydantic.dev/docs/validation/latest/concepts/validators/#field-after-validator) inside of `Annotated`.
 
 /// tip
 
-Pydantic also has [`BeforeValidator`](https://docs.pydantic.dev/latest/concepts/validators/#field-before-validator) and others. 🤓
+Pydantic also has [`BeforeValidator`](https://pydantic.dev/docs/validation/latest/concepts/validators/#field-before-validator) and others. 🤓
 
 ///
 
index 280162531dba1dcedbb6fa81a5dc3dff50e680f3..792be68fc0c6bb2dffc9a7b81ecfdebd42c6e381 100644 (file)
@@ -12,7 +12,7 @@ You can declare `examples` for a Pydantic model that will be added to the genera
 
 That extra info will be added as-is to the output **JSON Schema** for that model, and it will be used in the API docs.
 
-You can use the attribute `model_config` that takes a `dict` as described in [Pydantic's docs: Configuration](https://docs.pydantic.dev/latest/api/config/).
+You can use the attribute `model_config` that takes a `dict` as described in [Pydantic's docs: Configuration](https://pydantic.dev/docs/validation/latest/api/pydantic/config/).
 
 You can set `"json_schema_extra"` with a `dict` containing any additional data you would like to show up in the generated JSON Schema, including `examples`.