Browse Source

Fix redirect docs.pydantic.dev

pull/15967/head
Yurii Motov 2 weeks ago
parent
commit
e276b7fd37
  1. 4
      README.md
  2. 2
      docs/en/docs/advanced/dataclasses.md
  3. 2
      docs/en/docs/advanced/openapi-callbacks.md
  4. 6
      docs/en/docs/advanced/settings.md
  5. 2
      docs/en/docs/alternatives.md
  6. 2
      docs/en/docs/features.md
  7. 2
      docs/en/docs/history-design-future.md
  8. 2
      docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
  9. 4
      docs/en/docs/index.md
  10. 2
      docs/en/docs/project-generation.md
  11. 4
      docs/en/docs/python-types.md
  12. 2
      docs/en/docs/release-notes.md
  13. 2
      docs/en/docs/tutorial/body-nested-models.md
  14. 2
      docs/en/docs/tutorial/body.md
  15. 2
      docs/en/docs/tutorial/extra-data-types.md
  16. 2
      docs/en/docs/tutorial/extra-models.md
  17. 2
      docs/en/docs/tutorial/path-params.md
  18. 4
      docs/en/docs/tutorial/query-params-str-validations.md
  19. 2
      docs/en/docs/tutorial/schema-extra-example.md

4
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:

2
docs/en/docs/advanced/dataclasses.md

@ -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 }

2
docs/en/docs/advanced/openapi-callbacks.md

@ -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.
///

6
docs/en/docs/advanced/settings.md

@ -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/).
///

2
docs/en/docs/alternatives.md

@ -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.

2
docs/en/docs/features.md

@ -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.

2
docs/en/docs/history-design-future.md

@ -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.

2
docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md

@ -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.

4
docs/en/docs/index.md

@ -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:

2
docs/en/docs/project-generation.md

@ -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.

4
docs/en/docs/python-types.md

@ -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/).
///

2
docs/en/docs/release-notes.md

@ -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/).

2
docs/en/docs/tutorial/body-nested-models.md

@ -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`:

2
docs/en/docs/tutorial/body.md

@ -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

2
docs/en/docs/tutorial/extra-data-types.md

@ -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`.

2
docs/en/docs/tutorial/extra-models.md

@ -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]`.
///

2
docs/en/docs/tutorial/path-params.md

@ -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.

4
docs/en/docs/tutorial/query-params-str-validations.md

@ -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. 🤓
///

2
docs/en/docs/tutorial/schema-extra-example.md

@ -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`.

Loading…
Cancel
Save