@@ -52,7 +57,7 @@ FastAPI ✔️ 🎆 👪 👈 🙋 👫👫 ⚪️➡️ 🌐 🖥.
📥 **FastAPI 🕴**. 👶
-👫 👩💻 👈 ✔️ [ℹ 🎏 🏆 ⏮️ ❔ 📂](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} 🔘 *🌐 🕰*.
+👫 👩💻 👈 ✔️ [ℹ 🎏 🏆 ⏮️ ❔ 📂](help-fastapi.md#i){.internal-link target=_blank} 🔘 *🌐 🕰*.
👫 ✔️ 🎦 🕴 🤝 📚 🎏. 👶
@@ -70,7 +75,7 @@ FastAPI ✔️ 🎆 👪 👈 🙋 👫👫 ⚪️➡️ 🌐 🖥.
📥 **🔝 👨🔬**. 👶
-👉 👩💻 ✔️ [✍ 🏆 🚲 📨](help-fastapi.md#create-a-pull-request){.internal-link target=_blank} 👈 ✔️ *🔗*.
+👉 👩💻 ✔️ [✍ 🏆 🚲 📨](help-fastapi.md#_15){.internal-link target=_blank} 👈 ✔️ *🔗*.
👫 ✔️ 📉 ℹ 📟, 🧾, ✍, ♒️. 👶
@@ -92,7 +97,7 @@ FastAPI ✔️ 🎆 👪 👈 🙋 👫👫 ⚪️➡️ 🌐 🖥.
### 📄 ✍
-👤 🕴 💬 👩❤👨 🇪🇸 (& 🚫 📶 👍 👶). , 👨🔬 🕐 👈 ✔️ [**🏋️ ✔ ✍**](contributing.md#translations){.internal-link target=_blank} 🧾. 🍵 👫, 📤 🚫🔜 🧾 📚 🎏 🇪🇸.
+👤 🕴 💬 👩❤👨 🇪🇸 (& 🚫 📶 👍 👶). , 👨🔬 🕐 👈 ✔️ [**🏋️ ✔ ✍**](contributing.md#_9){.internal-link target=_blank} 🧾. 🍵 👫, 📤 🚫🔜 🧾 📚 🎏 🇪🇸.
---
diff --git a/docs/em/docs/features.md b/docs/em/docs/features.md
index 3693f4c54..6ef7c5ccc 100644
--- a/docs/em/docs/features.md
+++ b/docs/em/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# ⚒
## FastAPI ⚒
diff --git a/docs/em/docs/help-fastapi.md b/docs/em/docs/help-fastapi.md
index da452abf4..fbb9ca9a9 100644
--- a/docs/em/docs/help-fastapi.md
+++ b/docs/em/docs/help-fastapi.md
@@ -78,7 +78,7 @@
📚 💼 👆 5️⃣📆 ⏪ 💭 ❔ 📚 ❔. 👶
-🚥 👆 🤝 📚 👫👫 ⏮️ 👫 ❔, 👆 🔜 ▶️️ 🛂 [FastAPI 🕴](fastapi-people.md#experts){.internal-link target=_blank}. 👶
+🚥 👆 🤝 📚 👫👫 ⏮️ 👫 ❔, 👆 🔜 ▶️️ 🛂 [FastAPI 🕴](fastapi-people.md#_2){.internal-link target=_blank}. 👶
💭, 🏆 ⚠ ☝: 🔄 😇. 👫👫 👟 ⏮️ 👫 😩 & 📚 💼 🚫 💭 🏆 🌌, ✋️ 🔄 🏆 👆 💪 😇. 👶
@@ -198,7 +198,7 @@
* 🔧 🤭 👆 🔎 🔛 🧾.
* 💰 📄, 📹, ⚖️ 📻 👆 ✍ ⚖️ 🔎 🔃 FastAPI
✍ 👉 📁.
* ⚒ 💭 👆 🚮 👆 🔗 ▶️ 🔗 📄.
-* ℹ [💬 🧾](contributing.md#translations){.internal-link target=_blank} 👆 🇪🇸.
+* ℹ [💬 🧾](contributing.md#_9){.internal-link target=_blank} 👆 🇪🇸.
* 👆 💪 ℹ 📄 ✍ ✍ 🎏.
* 🛠️ 🆕 🧾 📄.
* 🔧 ♻ ❔/🐛.
@@ -215,8 +215,8 @@
👑 📋 👈 👆 💪 ▶️️ 🔜:
-* [ℹ 🎏 ⏮️ ❔ 📂](#help-others-with-questions-in-github){.internal-link target=_blank} (👀 📄 🔛).
-* [📄 🚲 📨](#review-pull-requests){.internal-link target=_blank} (👀 📄 🔛).
+* [ℹ 🎏 ⏮️ ❔ 📂](#i){.internal-link target=_blank} (👀 📄 🔛).
+* [📄 🚲 📨](#i){.internal-link target=_blank} (👀 📄 🔛).
👈 2️⃣ 📋 ⚫️❔ **🍴 🕰 🏆**. 👈 👑 👷 🏆 FastAPI.
@@ -227,7 +227,7 @@
🛑 👶
😧 💬 💽 👶 & 🤙 👅 ⏮️ 🎏 FastAPI 👪.
!!! tip
- ❔, 💭 👫
📂 💬, 📤 🌅 👍 🤞 👆 🔜 📨 ℹ [FastAPI 🕴](fastapi-people.md#experts){.internal-link target=_blank}.
+ ❔, 💭 👫
📂 💬, 📤 🌅 👍 🤞 👆 🔜 📨 ℹ [FastAPI 🕴](fastapi-people.md#_2){.internal-link target=_blank}.
⚙️ 💬 🕴 🎏 🏢 💬.
@@ -237,7 +237,7 @@
📂, 📄 🔜 🦮 👆 ✍ ▶️️ ❔ 👈 👆 💪 🌖 💪 🤚 👍 ❔, ⚖️ ❎ ⚠ 👆 ⏭ 💬. & 📂 👤 💪 ⚒ 💭 👤 🕧 ❔ 🌐, 🚥 ⚫️ ✊ 🕰. 👤 💪 🚫 🤙 👈 ⏮️ 💬 ⚙️. 👶
-💬 💬 ⚙️ 🚫 💪 📇 📂, ❔ & ❔ 5️⃣📆 🤚 💸 💬. & 🕴 🕐 📂 💯 ▶️️ [FastAPI 🕴](fastapi-people.md#experts){.internal-link target=_blank}, 👆 🔜 🌅 🎲 📨 🌅 🙋 📂.
+💬 💬 ⚙️ 🚫 💪 📇 📂, ❔ & ❔ 5️⃣📆 🤚 💸 💬. & 🕴 🕐 📂 💯 ▶️️ [FastAPI 🕴](fastapi-people.md#_2){.internal-link target=_blank}, 👆 🔜 🌅 🎲 📨 🌅 🙋 📂.
🔛 🎏 🚄, 📤 💯 👩💻 💬 ⚙️, 📤 ↕ 🤞 👆 🔜 🔎 👱 💬 📤, 🌖 🌐 🕰. 👶
diff --git a/docs/em/docs/how-to/custom-request-and-route.md b/docs/em/docs/how-to/custom-request-and-route.md
index d6fafa2ea..2d33d4feb 100644
--- a/docs/em/docs/how-to/custom-request-and-route.md
+++ b/docs/em/docs/how-to/custom-request-and-route.md
@@ -28,7 +28,7 @@
### ✍ 🛃 `GzipRequest` 🎓
!!! tip
- 👉 🧸 🖼 🎦 ❔ ⚫️ 👷, 🚥 👆 💪 🗜 🐕🦺, 👆 💪 ⚙️ 🚚 [`GzipMiddleware`](./middleware.md#gzipmiddleware){.internal-link target=_blank}.
+ 👉 🧸 🖼 🎦 ❔ ⚫️ 👷, 🚥 👆 💪 🗜 🐕🦺, 👆 💪 ⚙️ 🚚 [`GzipMiddleware`](../advanced/middleware.md#gzipmiddleware){.internal-link target=_blank}.
🥇, 👥 ✍ `GzipRequest` 🎓, ❔ 🔜 📁 `Request.body()` 👩🔬 🗜 💪 🔍 ☑ 🎚.
@@ -76,7 +76,7 @@
## 🔐 📨 💪 ⚠ 🐕🦺
!!! tip
- ❎ 👉 🎏 ⚠, ⚫️ 🎲 📚 ⏩ ⚙️ `body` 🛃 🐕🦺 `RequestValidationError` ([🚚 ❌](../tutorial/handling-errors.md#use-the-requestvalidationerror-body){.internal-link target=_blank}).
+ ❎ 👉 🎏 ⚠, ⚫️ 🎲 📚 ⏩ ⚙️ `body` 🛃 🐕🦺 `RequestValidationError` ([🚚 ❌](../tutorial/handling-errors.md#requestvalidationerror){.internal-link target=_blank}).
✋️ 👉 🖼 ☑ & ⚫️ 🎦 ❔ 🔗 ⏮️ 🔗 🦲.
diff --git a/docs/em/docs/how-to/sql-databases-peewee.md b/docs/em/docs/how-to/sql-databases-peewee.md
index 62619fc2c..8d633d7f6 100644
--- a/docs/em/docs/how-to/sql-databases-peewee.md
+++ b/docs/em/docs/how-to/sql-databases-peewee.md
@@ -86,7 +86,7 @@ connect_args={"check_same_thread": False}
!!! info "📡 ℹ"
- ⚫️❔ 🎏 📡 ℹ [🗄 (🔗) 💽](../tutorial/sql-databases.md#note){.internal-link target=_blank} ✔.
+ ⚫️❔ 🎏 📡 ℹ [🗄 (🔗) 💽](../tutorial/sql-databases.md#_7){.internal-link target=_blank} ✔.
### ⚒ 🏒 🔁-🔗 `PeeweeConnectionState`
diff --git a/docs/em/docs/index.md b/docs/em/docs/index.md
index a0ccfafb8..c4e41ce17 100644
--- a/docs/em/docs/index.md
+++ b/docs/em/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -31,7 +40,7 @@ FastAPI 🏛, ⏩ (↕-🎭), 🕸 🛠️ 🏗 🛠️ ⏮️ 🐍 3️⃣.8️
🔑 ⚒:
-* **⏩**: 📶 ↕ 🎭, 🔛 🇷🇪 ⏮️ **✳** & **🚶** (👏 💃 & Pydantic). [1️⃣ ⏩ 🐍 🛠️ 💪](#performance).
+* **⏩**: 📶 ↕ 🎭, 🔛 🇷🇪 ⏮️ **✳** & **🚶** (👏 💃 & Pydantic). [1️⃣ ⏩ 🐍 🛠️ 💪](#_15).
* **⏩ 📟**: 📈 🚅 🛠️ ⚒ 🔃 2️⃣0️⃣0️⃣ 💯 3️⃣0️⃣0️⃣ 💯. *
* **👩❤👨 🐛**: 📉 🔃 4️⃣0️⃣ 💯 🗿 (👩💻) 📉 ❌. *
* **🏋️**: 👑 👨🎨 🐕🦺.
🛠️ 🌐. 🌘 🕰 🛠️.
@@ -445,7 +454,6 @@ item: Item
⚙️ Pydantic:
-*
ujson
- ⏩ 🎻
"🎻".
*
email_validator
- 📧 🔬.
⚙️ 💃:
@@ -455,12 +463,12 @@ item: Item
*
python-multipart
- ✔ 🚥 👆 💚 🐕🦺 📨
"✍", ⏮️ `request.form()`.
*
itsdangerous
- ✔ `SessionMiddleware` 🐕🦺.
*
pyyaml
- ✔ 💃 `SchemaGenerator` 🐕🦺 (👆 🎲 🚫 💪 ⚫️ ⏮️ FastAPI).
-*
ujson
- ✔ 🚥 👆 💚 ⚙️ `UJSONResponse`.
⚙️ FastAPI / 💃:
*
uvicorn
- 💽 👈 📐 & 🍦 👆 🈸.
*
orjson
- ✔ 🚥 👆 💚 ⚙️ `ORJSONResponse`.
+*
ujson
- ✔ 🚥 👆 💚 ⚙️ `UJSONResponse`.
👆 💪 ❎ 🌐 👫 ⏮️ `pip install "fastapi[all]"`.
diff --git a/docs/em/docs/python-types.md b/docs/em/docs/python-types.md
index b8f61a113..b3026917a 100644
--- a/docs/em/docs/python-types.md
+++ b/docs/em/docs/python-types.md
@@ -168,7 +168,7 @@ John Doe
⚪️➡️ `typing`, 🗄 `List` (⏮️ 🔠 `L`):
- ``` Python hl_lines="1"
+ ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!}
```
diff --git a/docs/em/docs/tutorial/bigger-applications.md b/docs/em/docs/tutorial/bigger-applications.md
index c30bba106..fc9076aa8 100644
--- a/docs/em/docs/tutorial/bigger-applications.md
+++ b/docs/em/docs/tutorial/bigger-applications.md
@@ -119,7 +119,7 @@
!!! tip
👥 ⚙️ 💭 🎚 📉 👉 🖼.
- ✋️ 🎰 💼 👆 🔜 🤚 👍 🏁 ⚙️ 🛠️ [💂♂ 🚙](./security/index.md){.internal-link target=_blank}.
+ ✋️ 🎰 💼 👆 🔜 🤚 👍 🏁 ⚙️ 🛠️ [💂♂ 🚙](security/index.md){.internal-link target=_blank}.
## ➕1️⃣ 🕹 ⏮️ `APIRouter`
diff --git a/docs/em/docs/tutorial/body-updates.md b/docs/em/docs/tutorial/body-updates.md
index 98058ab52..89bb615f6 100644
--- a/docs/em/docs/tutorial/body-updates.md
+++ b/docs/em/docs/tutorial/body-updates.md
@@ -48,7 +48,7 @@
👉 ⛓ 👈 👆 💪 📨 🕴 💽 👈 👆 💚 ℹ, 🍂 🎂 🐣.
-!!! Note
+!!! note
`PATCH` 🌘 🛎 ⚙️ & 💭 🌘 `PUT`.
& 📚 🏉 ⚙️ 🕴 `PUT`, 🍕 ℹ.
diff --git a/docs/em/docs/tutorial/body.md b/docs/em/docs/tutorial/body.md
index db850162a..12f5a6315 100644
--- a/docs/em/docs/tutorial/body.md
+++ b/docs/em/docs/tutorial/body.md
@@ -210,4 +210,4 @@
## 🍵 Pydantic
-🚥 👆 🚫 💚 ⚙️ Pydantic 🏷, 👆 💪 ⚙️ **💪** 🔢. 👀 🩺 [💪 - 💗 🔢: ⭐ 💲 💪](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
+🚥 👆 🚫 💚 ⚙️ Pydantic 🏷, 👆 💪 ⚙️ **💪** 🔢. 👀 🩺 [💪 - 💗 🔢: ⭐ 💲 💪](body-multiple-params.md#_2){.internal-link target=_blank}.
diff --git a/docs/em/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/em/docs/tutorial/dependencies/dependencies-with-yield.md
index 9617667f4..3ed5aeba5 100644
--- a/docs/em/docs/tutorial/dependencies/dependencies-with-yield.md
+++ b/docs/em/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -99,7 +99,7 @@ FastAPI 🐕🦺 🔗 👈
`async` and `await`.
+ If you need a refresher about when to use which, check out the section _"In a hurry?"_ in the docs about [`async` and `await`](../async.md#in-a-hurry){.internal-link target=_blank}.
9. This *path operation function* is not returning dataclasses (although it could), but a list of dictionaries with internal data.
diff --git a/docs/en/docs/advanced/events.md b/docs/en/docs/advanced/events.md
index ca9d86ae4..703fcb7ae 100644
--- a/docs/en/docs/advanced/events.md
+++ b/docs/en/docs/advanced/events.md
@@ -159,4 +159,4 @@ Underneath, in the ASGI technical specification, this is part of the ../../../docs_src/generate_clients/tutorial004.js!}
```
@@ -271,7 +271,7 @@ After generating the new client, you would now have **clean method names**, with
## Benefits
-When using the automatically generated clients you would **autocompletion** for:
+When using the automatically generated clients you would get **autocompletion** for:
* Methods.
* Request payloads in the body, query parameters, etc.
diff --git a/docs/en/docs/advanced/openapi-callbacks.md b/docs/en/docs/advanced/openapi-callbacks.md
index fb7a6d917..2785ee140 100644
--- a/docs/en/docs/advanced/openapi-callbacks.md
+++ b/docs/en/docs/advanced/openapi-callbacks.md
@@ -131,7 +131,7 @@ with a JSON body of:
}
```
-Then *your API* will process the invoice, and at some point later, send a callback request to the `callback_url` (the *external API*):
+then *your API* will process the invoice, and at some point later, send a callback request to the `callback_url` (the *external API*):
```
https://www.external.org/events/invoices/2expen51ve
@@ -174,6 +174,6 @@ Now use the parameter `callbacks` in *your API's path operation decorator* to pa
Now you can start your app with Uvicorn and go to http://127.0.0.1:8000/docs.
-You will see your docs including a "Callback" section for your *path operation* that shows how the *external API* should look like:
+You will see your docs including a "Callbacks" section for your *path operation* that shows how the *external API* should look like:
diff --git a/docs/en/docs/advanced/path-operation-advanced-configuration.md b/docs/en/docs/advanced/path-operation-advanced-configuration.md
index 8b79bfe22..c5544a78b 100644
--- a/docs/en/docs/advanced/path-operation-advanced-configuration.md
+++ b/docs/en/docs/advanced/path-operation-advanced-configuration.md
@@ -59,7 +59,7 @@ That defines the metadata about the main response of a *path operation*.
You can also declare additional responses with their models, status codes, etc.
-There's a whole chapter here in the documentation about it, you can read it at [Additional Responses in OpenAPI](./additional-responses.md){.internal-link target=_blank}.
+There's a whole chapter here in the documentation about it, you can read it at [Additional Responses in OpenAPI](additional-responses.md){.internal-link target=_blank}.
## OpenAPI Extra
@@ -77,7 +77,7 @@ This *path operation*-specific OpenAPI schema is normally generated automaticall
!!! tip
This is a low level extension point.
- If you only need to declare additional responses, a more convenient way to do it is with [Additional Responses in OpenAPI](./additional-responses.md){.internal-link target=_blank}.
+ If you only need to declare additional responses, a more convenient way to do it is with [Additional Responses in OpenAPI](additional-responses.md){.internal-link target=_blank}.
You can extend the OpenAPI schema for a *path operation* using the parameter `openapi_extra`.
diff --git a/docs/en/docs/advanced/settings.md b/docs/en/docs/advanced/settings.md
index f6db8d2b1..8f72bf63a 100644
--- a/docs/en/docs/advanced/settings.md
+++ b/docs/en/docs/advanced/settings.md
@@ -232,7 +232,7 @@ And then use it in a file `main.py`:
```
!!! tip
- You would also need a file `__init__.py` as you saw on [Bigger Applications - Multiple Files](../tutorial/bigger-applications.md){.internal-link target=_blank}.
+ You would also need a file `__init__.py` as you saw in [Bigger Applications - Multiple Files](../tutorial/bigger-applications.md){.internal-link target=_blank}.
## Settings in a dependency
diff --git a/docs/en/docs/advanced/sub-applications.md b/docs/en/docs/advanced/sub-applications.md
index a089632ac..8c52e091f 100644
--- a/docs/en/docs/advanced/sub-applications.md
+++ b/docs/en/docs/advanced/sub-applications.md
@@ -70,4 +70,4 @@ That way, the sub-application will know to use that path prefix for the docs UI.
And the sub-application could also have its own mounted sub-applications and everything would work correctly, because FastAPI handles all these `root_path`s automatically.
-You will learn more about the `root_path` and how to use it explicitly in the section about [Behind a Proxy](./behind-a-proxy.md){.internal-link target=_blank}.
+You will learn more about the `root_path` and how to use it explicitly in the section about [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank}.
diff --git a/docs/en/docs/advanced/wsgi.md b/docs/en/docs/advanced/wsgi.md
index cfe3c78c1..852e25019 100644
--- a/docs/en/docs/advanced/wsgi.md
+++ b/docs/en/docs/advanced/wsgi.md
@@ -1,6 +1,6 @@
# Including WSGI - Flask, Django, others
-You can mount WSGI applications as you saw with [Sub Applications - Mounts](./sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](./behind-a-proxy.md){.internal-link target=_blank}.
+You can mount WSGI applications as you saw with [Sub Applications - Mounts](sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank}.
For that, you can use the `WSGIMiddleware` and use it to wrap your WSGI application, for example, Flask, Django, etc.
diff --git a/docs/en/docs/alternatives.md b/docs/en/docs/alternatives.md
index d351c4e0b..9a101a8a1 100644
--- a/docs/en/docs/alternatives.md
+++ b/docs/en/docs/alternatives.md
@@ -1,6 +1,6 @@
# Alternatives, Inspiration and Comparisons
-What inspired **FastAPI**, how it compares to other alternatives and what it learned from them.
+What inspired **FastAPI**, how it compares to alternatives and what it learned from them.
## Intro
@@ -117,7 +117,7 @@ That's why when talking about version 2.0 it's common to say "Swagger", and for
* Swagger UI
* ReDoc
- These two were chosen for being fairly popular and stable, but doing a quick search, you could find dozens of additional alternative user interfaces for OpenAPI (that you can use with **FastAPI**).
+ These two were chosen for being fairly popular and stable, but doing a quick search, you could find dozens of alternative user interfaces for OpenAPI (that you can use with **FastAPI**).
### Flask REST frameworks
@@ -291,7 +291,7 @@ As it is based on the previous standard for synchronous Python web frameworks (W
!!! info
Hug was created by Timothy Crosley, the same creator of `isort`, a great tool to automatically sort imports in Python files.
-!!! check "Ideas inspired in **FastAPI**"
+!!! check "Ideas inspiring **FastAPI**"
Hug inspired parts of APIStar, and was one of the tools I found most promising, alongside APIStar.
Hug helped inspiring **FastAPI** to use Python type hints to declare parameters, and to generate a schema defining the API automatically.
diff --git a/docs/en/docs/async.md b/docs/en/docs/async.md
index ff322635a..a0c00933a 100644
--- a/docs/en/docs/async.md
+++ b/docs/en/docs/async.md
@@ -397,7 +397,7 @@ All that is what powers FastAPI (through Starlette) and what makes it have such
These are very technical details of how **FastAPI** works underneath.
- If you have quite some technical knowledge (co-routines, threads, blocking, etc.) and are curious about how FastAPI handles `async def` vs normal `def`, go ahead.
+ If you have quite some technical knowledge (coroutines, threads, blocking, etc.) and are curious about how FastAPI handles `async def` vs normal `def`, go ahead.
### Path operation functions
@@ -409,11 +409,11 @@ Still, in both situations, chances are that **FastAPI** will [still be faster](i
### Dependencies
-The same applies for [dependencies](./tutorial/dependencies/index.md){.internal-link target=_blank}. If a dependency is a standard `def` function instead of `async def`, it is run in the external threadpool.
+The same applies for [dependencies](tutorial/dependencies/index.md){.internal-link target=_blank}. If a dependency is a standard `def` function instead of `async def`, it is run in the external threadpool.
### Sub-dependencies
-You can have multiple dependencies and [sub-dependencies](./tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} requiring each other (as parameters of the function definitions), some of them might be created with `async def` and some with normal `def`. It would still work, and the ones created with normal `def` would be called on an external thread (from the threadpool) instead of being "awaited".
+You can have multiple dependencies and [sub-dependencies](tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} requiring each other (as parameters of the function definitions), some of them might be created with `async def` and some with normal `def`. It would still work, and the ones created with normal `def` would be called on an external thread (from the threadpool) instead of being "awaited".
### Other utility functions
diff --git a/docs/en/docs/benchmarks.md b/docs/en/docs/benchmarks.md
index d746b6d7c..62266c449 100644
--- a/docs/en/docs/benchmarks.md
+++ b/docs/en/docs/benchmarks.md
@@ -1,6 +1,6 @@
# Benchmarks
-Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as one of the fastest Python frameworks available, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
+Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as one of the fastest Python frameworks available, only below Starlette and Uvicorn themselves (used internally by FastAPI).
But when checking benchmarks and comparisons you should keep the following in mind.
diff --git a/docs/en/docs/deployment/concepts.md b/docs/en/docs/deployment/concepts.md
index cc01fb24e..b771ae663 100644
--- a/docs/en/docs/deployment/concepts.md
+++ b/docs/en/docs/deployment/concepts.md
@@ -25,7 +25,7 @@ But for now, let's check these important **conceptual ideas**. These concepts al
## Security - HTTPS
-In the [previous chapter about HTTPS](./https.md){.internal-link target=_blank} we learned about how HTTPS provides encryption for your API.
+In the [previous chapter about HTTPS](https.md){.internal-link target=_blank} we learned about how HTTPS provides encryption for your API.
We also saw that HTTPS is normally provided by a component **external** to your application server, a **TLS Termination Proxy**.
@@ -187,7 +187,7 @@ When you run **multiple processes** of the same API program, they are commonly c
### Worker Processes and Ports
-Remember from the docs [About HTTPS](./https.md){.internal-link target=_blank} that only one process can be listening on one combination of port and IP address in a server?
+Remember from the docs [About HTTPS](https.md){.internal-link target=_blank} that only one process can be listening on one combination of port and IP address in a server?
This is still true.
@@ -230,18 +230,18 @@ The main constraint to consider is that there has to be a **single** component h
Here are some possible combinations and strategies:
* **Gunicorn** managing **Uvicorn workers**
- * Gunicorn would be the **process manager** listening on the **IP** and **port**, the replication would be by having **multiple Uvicorn worker processes**
+ * Gunicorn would be the **process manager** listening on the **IP** and **port**, the replication would be by having **multiple Uvicorn worker processes**.
* **Uvicorn** managing **Uvicorn workers**
- * One Uvicorn **process manager** would listen on the **IP** and **port**, and it would start **multiple Uvicorn worker processes**
+ * One Uvicorn **process manager** would listen on the **IP** and **port**, and it would start **multiple Uvicorn worker processes**.
* **Kubernetes** and other distributed **container systems**
- * Something in the **Kubernetes** layer would listen on the **IP** and **port**. The replication would be by having **multiple containers**, each with **one Uvicorn process** running
+ * Something in the **Kubernetes** layer would listen on the **IP** and **port**. The replication would be by having **multiple containers**, each with **one Uvicorn process** running.
* **Cloud services** that handle this for you
* The cloud service will probably **handle replication for you**. It would possibly let you define **a process to run**, or a **container image** to use, in any case, it would most probably be **a single Uvicorn process**, and the cloud service would be in charge of replicating it.
!!! tip
Don't worry if some of these items about **containers**, Docker, or Kubernetes don't make a lot of sense yet.
- I'll tell you more about container images, Docker, Kubernetes, etc. in a future chapter: [FastAPI in Containers - Docker](./docker.md){.internal-link target=_blank}.
+ I'll tell you more about container images, Docker, Kubernetes, etc. in a future chapter: [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank}.
## Previous Steps Before Starting
@@ -273,7 +273,7 @@ Here are some possible ideas:
* You would still need a way to start/restart *that* bash script, detect errors, etc.
!!! tip
- I'll give you more concrete examples for doing this with containers in a future chapter: [FastAPI in Containers - Docker](./docker.md){.internal-link target=_blank}.
+ I'll give you more concrete examples for doing this with containers in a future chapter: [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank}.
## Resource Utilization
diff --git a/docs/en/docs/deployment/docker.md b/docs/en/docs/deployment/docker.md
index 8a542622e..467ba72de 100644
--- a/docs/en/docs/deployment/docker.md
+++ b/docs/en/docs/deployment/docker.md
@@ -108,7 +108,7 @@ It would depend mainly on the tool you use to **install** those requirements.
The most common way to do it is to have a file `requirements.txt` with the package names and their versions, one per line.
-You would of course use the same ideas you read in [About FastAPI versions](./versions.md){.internal-link target=_blank} to set the ranges of versions.
+You would of course use the same ideas you read in [About FastAPI versions](versions.md){.internal-link target=_blank} to set the ranges of versions.
For example, your `requirements.txt` could look like:
@@ -373,7 +373,7 @@ Then adjust the Uvicorn command to use the new module `main` instead of `app.mai
## Deployment Concepts
-Let's talk again about some of the same [Deployment Concepts](./concepts.md){.internal-link target=_blank} in terms of containers.
+Let's talk again about some of the same [Deployment Concepts](concepts.md){.internal-link target=_blank} in terms of containers.
Containers are mainly a tool to simplify the process of **building and deploying** an application, but they don't enforce a particular approach to handle these **deployment concepts**, and there are several possible strategies.
@@ -514,7 +514,7 @@ If you have a simple setup, with a **single container** that then starts multipl
## Official Docker Image with Gunicorn - Uvicorn
-There is an official Docker image that includes Gunicorn running with Uvicorn workers, as detailed in a previous chapter: [Server Workers - Gunicorn with Uvicorn](./server-workers.md){.internal-link target=_blank}.
+There is an official Docker image that includes Gunicorn running with Uvicorn workers, as detailed in a previous chapter: [Server Workers - Gunicorn with Uvicorn](server-workers.md){.internal-link target=_blank}.
This image would be useful mainly in the situations described above in: [Containers with Multiple Processes and Special Cases](#containers-with-multiple-processes-and-special-cases).
diff --git a/docs/en/docs/deployment/server-workers.md b/docs/en/docs/deployment/server-workers.md
index 2df9f3d43..5fe2309a9 100644
--- a/docs/en/docs/deployment/server-workers.md
+++ b/docs/en/docs/deployment/server-workers.md
@@ -13,12 +13,12 @@ Up to this point, with all the tutorials in the docs, you have probably been run
When deploying applications you will probably want to have some **replication of processes** to take advantage of **multiple cores** and to be able to handle more requests.
-As you saw in the previous chapter about [Deployment Concepts](./concepts.md){.internal-link target=_blank}, there are multiple strategies you can use.
+As you saw in the previous chapter about [Deployment Concepts](concepts.md){.internal-link target=_blank}, there are multiple strategies you can use.
Here I'll show you how to use **Gunicorn** with **Uvicorn worker processes**.
!!! info
- If you are using containers, for example with Docker or Kubernetes, I'll tell you more about that in the next chapter: [FastAPI in Containers - Docker](./docker.md){.internal-link target=_blank}.
+ If you are using containers, for example with Docker or Kubernetes, I'll tell you more about that in the next chapter: [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank}.
In particular, when running on **Kubernetes** you will probably **not** want to use Gunicorn and instead run **a single Uvicorn process per container**, but I'll tell you about it later in that chapter.
@@ -165,7 +165,7 @@ From the list of deployment concepts from above, using workers would mainly help
## Containers and Docker
-In the next chapter about [FastAPI in Containers - Docker](./docker.md){.internal-link target=_blank} I'll tell some strategies you could use to handle the other **deployment concepts**.
+In the next chapter about [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank} I'll tell some strategies you could use to handle the other **deployment concepts**.
I'll also show you the **official Docker image** that includes **Gunicorn with Uvicorn workers** and some default configurations that can be useful for simple cases.
diff --git a/docs/en/docs/help-fastapi.md b/docs/en/docs/help-fastapi.md
index 1d76aca5e..121447739 100644
--- a/docs/en/docs/help-fastapi.md
+++ b/docs/en/docs/help-fastapi.md
@@ -51,7 +51,7 @@ You can:
* Tell me how you use FastAPI (I love to hear that).
* Hear when I make announcements or release new tools.
* You can also follow @fastapi on Twitter (a separate account).
-* Follow me on **Linkedin**.
+* Follow me on **LinkedIn**.
* Hear when I make announcements or release new tools (although I use Twitter more often 🤷♂).
* Read what I write (or follow me) on **Dev.to** or **Medium**.
* Read other ideas, articles, and read about tools I have created.
@@ -78,7 +78,7 @@ You can try and help others with their questions in:
In many cases you might already know the answer for those questions. 🤓
-If you are helping a lot of people with their questions, you will become an official [FastAPI Expert](fastapi-people.md#experts){.internal-link target=_blank}. 🎉
+If you are helping a lot of people with their questions, you will become an official [FastAPI Expert](fastapi-people.md#fastapi-experts){.internal-link target=_blank}. 🎉
Just remember, the most important point is: try to be kind. People come with their frustrations and in many cases don't ask in the best way, but try as best as you can to be kind. 🤗
@@ -227,7 +227,7 @@ If you can help me with that, **you are helping me maintain FastAPI** and making
Join the 👥 Discord chat server 👥 and hang out with others in the FastAPI community.
!!! tip
- For questions, ask them in GitHub Discussions, there's a much better chance you will receive help by the [FastAPI Experts](fastapi-people.md#experts){.internal-link target=_blank}.
+ For questions, ask them in GitHub Discussions, there's a much better chance you will receive help by the [FastAPI Experts](fastapi-people.md#fastapi-experts){.internal-link target=_blank}.
Use the chat only for other general conversations.
@@ -237,7 +237,7 @@ Keep in mind that as chats allow more "free conversation", it's easy to ask ques
In GitHub, the template will guide you to write the right question so that you can more easily get a good answer, or even solve the problem yourself even before asking. And in GitHub I can make sure I always answer everything, even if it takes some time. I can't personally do that with the chat systems. 😅
-Conversations in the chat systems are also not as easily searchable as in GitHub, so questions and answers might get lost in the conversation. And only the ones in GitHub count to become a [FastAPI Expert](fastapi-people.md#experts){.internal-link target=_blank}, so you will most probably receive more attention in GitHub.
+Conversations in the chat systems are also not as easily searchable as in GitHub, so questions and answers might get lost in the conversation. And only the ones in GitHub count to become a [FastAPI Expert](fastapi-people.md#fastapi-experts){.internal-link target=_blank}, so you will most probably receive more attention in GitHub.
On the other side, there are thousands of users in the chat systems, so there's a high chance you'll find someone to talk to there, almost all the time. 😄
diff --git a/docs/en/docs/how-to/async-sql-encode-databases.md b/docs/en/docs/how-to/async-sql-encode-databases.md
index c7b340d67..4d53f53a7 100644
--- a/docs/en/docs/how-to/async-sql-encode-databases.md
+++ b/docs/en/docs/how-to/async-sql-encode-databases.md
@@ -100,7 +100,7 @@ Create the *path operation function* to read notes:
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
-!!! Note
+!!! note
Notice that as we communicate with the database using `await`, the *path operation function* is declared with `async`.
### Notice the `response_model=List[Note]`
@@ -122,7 +122,7 @@ Create the *path operation function* to create notes:
The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
-!!! Note
+!!! note
Notice that as we communicate with the database using `await`, the *path operation function* is declared with `async`.
### About `{**note.dict(), "id": last_record_id}`
diff --git a/docs/en/docs/how-to/configure-swagger-ui.md b/docs/en/docs/how-to/configure-swagger-ui.md
index f36ba5ba8..108afb929 100644
--- a/docs/en/docs/how-to/configure-swagger-ui.md
+++ b/docs/en/docs/how-to/configure-swagger-ui.md
@@ -45,7 +45,7 @@ FastAPI includes some default configuration parameters appropriate for most of t
It includes these default configurations:
```Python
-{!../../../fastapi/openapi/docs.py[ln:7-13]!}
+{!../../../fastapi/openapi/docs.py[ln:7-23]!}
```
You can override any of them by setting a different value in the argument `swagger_ui_parameters`.
diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md
index 86b0c699b..a5ed8b330 100644
--- a/docs/en/docs/index.md
+++ b/docs/en/docs/index.md
@@ -465,12 +465,12 @@ Used by Starlette:
* python-multipart
- Required if you want to support form "parsing", with `request.form()`.
* itsdangerous
- Required for `SessionMiddleware` support.
* pyyaml
- Required for Starlette's `SchemaGenerator` support (you probably don't need it with FastAPI).
-* ujson
- Required if you want to use `UJSONResponse`.
Used by FastAPI / Starlette:
* uvicorn
- for the server that loads and serves your application.
* orjson
- Required if you want to use `ORJSONResponse`.
+* ujson
- Required if you want to use `UJSONResponse`.
You can install all of these with `pip install "fastapi[all]"`.
diff --git a/docs/en/docs/python-types.md b/docs/en/docs/python-types.md
index 51db744ff..3e8267aea 100644
--- a/docs/en/docs/python-types.md
+++ b/docs/en/docs/python-types.md
@@ -186,7 +186,7 @@ For example, let's define a variable to be a `list` of `str`.
From `typing`, import `List` (with a capital `L`):
- ``` Python hl_lines="1"
+ ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!}
```
diff --git a/docs/en/docs/reference/apirouter.md b/docs/en/docs/reference/apirouter.md
index b779ad291..d77364e45 100644
--- a/docs/en/docs/reference/apirouter.md
+++ b/docs/en/docs/reference/apirouter.md
@@ -1,7 +1,6 @@
# `APIRouter` class
-Here's the reference information for the `APIRouter` class, with all its parameters,
-attributes and methods.
+Here's the reference information for the `APIRouter` class, with all its parameters, attributes and methods.
You can import the `APIRouter` class directly from `fastapi`:
diff --git a/docs/en/docs/reference/background.md b/docs/en/docs/reference/background.md
index e0c0be899..f65619590 100644
--- a/docs/en/docs/reference/background.md
+++ b/docs/en/docs/reference/background.md
@@ -1,8 +1,6 @@
# Background Tasks - `BackgroundTasks`
-You can declare a parameter in a *path operation function* or dependency function
-with the type `BackgroundTasks`, and then you can use it to schedule the execution
-of background tasks after the response is sent.
+You can declare a parameter in a *path operation function* or dependency function with the type `BackgroundTasks`, and then you can use it to schedule the execution of background tasks after the response is sent.
You can import it directly from `fastapi`:
diff --git a/docs/en/docs/reference/dependencies.md b/docs/en/docs/reference/dependencies.md
index 099968267..2959a21da 100644
--- a/docs/en/docs/reference/dependencies.md
+++ b/docs/en/docs/reference/dependencies.md
@@ -2,8 +2,7 @@
## `Depends()`
-Dependencies are handled mainly with the special function `Depends()` that takes a
-callable.
+Dependencies are handled mainly with the special function `Depends()` that takes a callable.
Here is the reference for it and its parameters.
@@ -17,11 +16,9 @@ from fastapi import Depends
## `Security()`
-For many scenarios, you can handle security (authorization, authentication, etc.) with
-dependencies, using `Depends()`.
+For many scenarios, you can handle security (authorization, authentication, etc.) with dependencies, using `Depends()`.
-But when you want to also declare OAuth2 scopes, you can use `Security()` instead of
-`Depends()`.
+But when you want to also declare OAuth2 scopes, you can use `Security()` instead of `Depends()`.
You can import `Security()` directly from `fastapi`:
diff --git a/docs/en/docs/reference/exceptions.md b/docs/en/docs/reference/exceptions.md
index 7c4808349..1392d2a80 100644
--- a/docs/en/docs/reference/exceptions.md
+++ b/docs/en/docs/reference/exceptions.md
@@ -2,9 +2,7 @@
These are the exceptions that you can raise to show errors to the client.
-When you raise an exception, as would happen with normal Python, the rest of the
-execution is aborted. This way you can raise these exceptions from anywhere in the
-code to abort a request and show the error to the client.
+When you raise an exception, as would happen with normal Python, the rest of the execution is aborted. This way you can raise these exceptions from anywhere in the code to abort a request and show the error to the client.
You can use:
diff --git a/docs/en/docs/reference/fastapi.md b/docs/en/docs/reference/fastapi.md
index 8b87664cb..d5367ff34 100644
--- a/docs/en/docs/reference/fastapi.md
+++ b/docs/en/docs/reference/fastapi.md
@@ -1,7 +1,6 @@
# `FastAPI` class
-Here's the reference information for the `FastAPI` class, with all its parameters,
-attributes and methods.
+Here's the reference information for the `FastAPI` class, with all its parameters, attributes and methods.
You can import the `FastAPI` class directly from `fastapi`:
diff --git a/docs/en/docs/reference/httpconnection.md b/docs/en/docs/reference/httpconnection.md
index 43dfc46f9..b7b87871a 100644
--- a/docs/en/docs/reference/httpconnection.md
+++ b/docs/en/docs/reference/httpconnection.md
@@ -1,8 +1,6 @@
# `HTTPConnection` class
-When you want to define dependencies that should be compatible with both HTTP and
-WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a
-`Request` or a `WebSocket`.
+When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
You can import it from `fastapi.requests`:
diff --git a/docs/en/docs/reference/middleware.md b/docs/en/docs/reference/middleware.md
index 89704d3c8..3c666ccda 100644
--- a/docs/en/docs/reference/middleware.md
+++ b/docs/en/docs/reference/middleware.md
@@ -2,8 +2,7 @@
There are several middlewares available provided by Starlette directly.
-Read more about them in the
-[FastAPI docs for Middleware](https://fastapi.tiangolo.com/advanced/middleware/).
+Read more about them in the [FastAPI docs for Middleware](https://fastapi.tiangolo.com/advanced/middleware/).
::: fastapi.middleware.cors.CORSMiddleware
diff --git a/docs/en/docs/reference/parameters.md b/docs/en/docs/reference/parameters.md
index 8f77f0161..d304c013c 100644
--- a/docs/en/docs/reference/parameters.md
+++ b/docs/en/docs/reference/parameters.md
@@ -2,8 +2,7 @@
Here's the reference information for the request parameters.
-These are the special functions that you can put in *path operation function*
-parameters or dependency functions with `Annotated` to get data from the request.
+These are the special functions that you can put in *path operation function* parameters or dependency functions with `Annotated` to get data from the request.
It includes:
diff --git a/docs/en/docs/reference/request.md b/docs/en/docs/reference/request.md
index 91ec7d37b..0326f3fc7 100644
--- a/docs/en/docs/reference/request.md
+++ b/docs/en/docs/reference/request.md
@@ -1,8 +1,6 @@
# `Request` class
-You can declare a parameter in a *path operation function* or dependency to be of type
-`Request` and then you can access the raw request object directly, without any
-validation, etc.
+You can declare a parameter in a *path operation function* or dependency to be of type `Request` and then you can access the raw request object directly, without any validation, etc.
You can import it directly from `fastapi`:
@@ -11,8 +9,6 @@ from fastapi import Request
```
!!! tip
- When you want to define dependencies that should be compatible with both HTTP and
- WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a
- `Request` or a `WebSocket`.
+ When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
::: fastapi.Request
diff --git a/docs/en/docs/reference/response.md b/docs/en/docs/reference/response.md
index 916254583..00cf2c499 100644
--- a/docs/en/docs/reference/response.md
+++ b/docs/en/docs/reference/response.md
@@ -1,10 +1,8 @@
# `Response` class
-You can declare a parameter in a *path operation function* or dependency to be of type
-`Response` and then you can set data for the response like headers or cookies.
+You can declare a parameter in a *path operation function* or dependency to be of type `Response` and then you can set data for the response like headers or cookies.
-You can also use it directly to create an instance of it and return it from your *path
-operations*.
+You can also use it directly to create an instance of it and return it from your *path operations*.
You can import it directly from `fastapi`:
diff --git a/docs/en/docs/reference/responses.md b/docs/en/docs/reference/responses.md
index 2cbbd8963..46f014fcc 100644
--- a/docs/en/docs/reference/responses.md
+++ b/docs/en/docs/reference/responses.md
@@ -1,10 +1,8 @@
# Custom Response Classes - File, HTML, Redirect, Streaming, etc.
-There are several custom response classes you can use to create an instance and return
-them directly from your *path operations*.
+There are several custom response classes you can use to create an instance and return them directly from your *path operations*.
-Read more about it in the
-[FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
+Read more about it in the [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
You can import them directly from `fastapi.responses`:
diff --git a/docs/en/docs/reference/security/index.md b/docs/en/docs/reference/security/index.md
index ff86e9e30..9a5c5e15f 100644
--- a/docs/en/docs/reference/security/index.md
+++ b/docs/en/docs/reference/security/index.md
@@ -2,12 +2,9 @@
When you need to declare dependencies with OAuth2 scopes you use `Security()`.
-But you still need to define what is the dependable, the callable that you pass as
-a parameter to `Depends()` or `Security()`.
+But you still need to define what is the dependable, the callable that you pass as a parameter to `Depends()` or `Security()`.
-There are multiple tools that you can use to create those dependables, and they get
-integrated into OpenAPI so they are shown in the automatic docs UI, they can be used
-by automatically generated clients and SDKs, etc.
+There are multiple tools that you can use to create those dependables, and they get integrated into OpenAPI so they are shown in the automatic docs UI, they can be used by automatically generated clients and SDKs, etc.
You can import them from `fastapi.security`:
diff --git a/docs/en/docs/reference/staticfiles.md b/docs/en/docs/reference/staticfiles.md
index ce66f17b3..271231078 100644
--- a/docs/en/docs/reference/staticfiles.md
+++ b/docs/en/docs/reference/staticfiles.md
@@ -2,8 +2,7 @@
You can use the `StaticFiles` class to serve static files, like JavaScript, CSS, images, etc.
-Read more about it in the
-[FastAPI docs for Static Files](https://fastapi.tiangolo.com/tutorial/static-files/).
+Read more about it in the [FastAPI docs for Static Files](https://fastapi.tiangolo.com/tutorial/static-files/).
You can import it directly from `fastapi.staticfiles`:
diff --git a/docs/en/docs/reference/status.md b/docs/en/docs/reference/status.md
index a23800792..6e0e816d3 100644
--- a/docs/en/docs/reference/status.md
+++ b/docs/en/docs/reference/status.md
@@ -16,12 +16,9 @@ For example:
* 403: `status.HTTP_403_FORBIDDEN`
* etc.
-It can be convenient to quickly access HTTP (and WebSocket) status codes in your app,
-using autocompletion for the name without having to remember the integer status codes
-by memory.
+It can be convenient to quickly access HTTP (and WebSocket) status codes in your app, using autocompletion for the name without having to remember the integer status codes by memory.
-Read more about it in the
-[FastAPI docs about Response Status Code](https://fastapi.tiangolo.com/tutorial/response-status-code/).
+Read more about it in the [FastAPI docs about Response Status Code](https://fastapi.tiangolo.com/tutorial/response-status-code/).
## Example
diff --git a/docs/en/docs/reference/templating.md b/docs/en/docs/reference/templating.md
index c865badfc..eedfe44d5 100644
--- a/docs/en/docs/reference/templating.md
+++ b/docs/en/docs/reference/templating.md
@@ -2,8 +2,7 @@
You can use the `Jinja2Templates` class to render Jinja templates.
-Read more about it in the
-[FastAPI docs for Templates](https://fastapi.tiangolo.com/advanced/templates/).
+Read more about it in the [FastAPI docs for Templates](https://fastapi.tiangolo.com/advanced/templates/).
You can import it directly from `fastapi.templating`:
diff --git a/docs/en/docs/reference/testclient.md b/docs/en/docs/reference/testclient.md
index e391d964a..2966ed792 100644
--- a/docs/en/docs/reference/testclient.md
+++ b/docs/en/docs/reference/testclient.md
@@ -2,8 +2,7 @@
You can use the `TestClient` class to test FastAPI applications without creating an actual HTTP and socket connection, just communicating directly with the FastAPI code.
-Read more about it in the
-[FastAPI docs for Testing](https://fastapi.tiangolo.com/tutorial/testing/).
+Read more about it in the [FastAPI docs for Testing](https://fastapi.tiangolo.com/tutorial/testing/).
You can import it directly from `fastapi.testclient`:
diff --git a/docs/en/docs/reference/uploadfile.md b/docs/en/docs/reference/uploadfile.md
index 45c644b18..43a753730 100644
--- a/docs/en/docs/reference/uploadfile.md
+++ b/docs/en/docs/reference/uploadfile.md
@@ -1,7 +1,6 @@
# `UploadFile` class
-You can define *path operation function* parameters to be of the type `UploadFile`
-to receive files from the request.
+You can define *path operation function* parameters to be of the type `UploadFile` to receive files from the request.
You can import it directly from `fastapi`:
diff --git a/docs/en/docs/reference/websockets.md b/docs/en/docs/reference/websockets.md
index 2a0469467..d21e81a07 100644
--- a/docs/en/docs/reference/websockets.md
+++ b/docs/en/docs/reference/websockets.md
@@ -1,7 +1,6 @@
# WebSockets
-When defining WebSockets, you normally declare a parameter of type `WebSocket` and
-with it you can read data from the client and send data to it.
+When defining WebSockets, you normally declare a parameter of type `WebSocket` and with it you can read data from the client and send data to it.
It is provided directly by Starlette, but you can import it from `fastapi`:
@@ -10,9 +9,7 @@ from fastapi import WebSocket
```
!!! tip
- When you want to define dependencies that should be compatible with both HTTP and
- WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a
- `Request` or a `WebSocket`.
+ When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
::: fastapi.WebSocket
options:
@@ -44,8 +41,7 @@ from fastapi import WebSocket
- send_json
- close
-When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch
-it.
+When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it.
You can import it directly form `fastapi`:
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 5ae22dde3..e61117245 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,11 +9,36 @@ hide:
### Docs
+* ✏️ Fix typo in `security/http.py`. PR [#11455](https://github.com/tiangolo/fastapi/pull/11455) by [@omarmoo5](https://github.com/omarmoo5).
+
+### Internal
+
+* ⬆️ Upgrade MkDocs Material and re-enable cards. PR [#11466](https://github.com/tiangolo/fastapi/pull/11466) by [@tiangolo](https://github.com/tiangolo).
+* ⬆ Bump pillow from 10.2.0 to 10.3.0. PR [#11403](https://github.com/tiangolo/fastapi/pull/11403) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* 🔧 Ungroup dependabot updates. PR [#11465](https://github.com/tiangolo/fastapi/pull/11465) by [@tiangolo](https://github.com/tiangolo).
+
+## 0.110.2
+
+### Fixes
+
+* 🐛 Fix support for query parameters with list types, handle JSON encoding Pydantic `UndefinedType`. PR [#9929](https://github.com/tiangolo/fastapi/pull/9929) by [@arjwilliams](https://github.com/arjwilliams).
+
+### Refactors
+
+* ♻️ Simplify Pydantic configs in OpenAPI models in `fastapi/openapi/models.py`. PR [#10886](https://github.com/tiangolo/fastapi/pull/10886) by [@JoeTanto2](https://github.com/JoeTanto2).
+* ✨ Add support for Pydantic's 2.7 new deprecated Field parameter, remove URL from validation errors response. PR [#11461](https://github.com/tiangolo/fastapi/pull/11461) by [@tiangolo](https://github.com/tiangolo).
+
+### Docs
+
+* 📝 Fix types in examples under `docs_src/extra_data_types`. PR [#10535](https://github.com/tiangolo/fastapi/pull/10535) by [@nilslindemann](https://github.com/nilslindemann).
+* 📝 Update references to UJSON. PR [#11464](https://github.com/tiangolo/fastapi/pull/11464) by [@tiangolo](https://github.com/tiangolo).
+* 📝 Tweak docs and translations links, typos, format. PR [#11389](https://github.com/tiangolo/fastapi/pull/11389) by [@nilslindemann](https://github.com/nilslindemann).
* 📝 Fix typo in `docs/es/docs/async.md`. PR [#11400](https://github.com/tiangolo/fastapi/pull/11400) by [@fabianfalon](https://github.com/fabianfalon).
* 📝 Update OpenAPI client generation docs to use `@hey-api/openapi-ts`. PR [#11339](https://github.com/tiangolo/fastapi/pull/11339) by [@jordanshatford](https://github.com/jordanshatford).
### Translations
+* 🌐 Update Chinese translation for `docs/zh/docs/index.html`. PR [#11430](https://github.com/tiangolo/fastapi/pull/11430) by [@waketzheng](https://github.com/waketzheng).
* 🌐 Add Russian translation for `docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. PR [#11411](https://github.com/tiangolo/fastapi/pull/11411) by [@anton2yakovlev](https://github.com/anton2yakovlev).
* 🌐 Add Portuguese translations for `learn/index.md` `resources/index.md` `help/index.md` `about/index.md`. PR [#10807](https://github.com/tiangolo/fastapi/pull/10807) by [@nazarepiedady](https://github.com/nazarepiedady).
* 🌐 Update Russian translations for deployments docs. PR [#11271](https://github.com/tiangolo/fastapi/pull/11271) by [@Lufa1u](https://github.com/Lufa1u).
diff --git a/docs/en/docs/tutorial/bigger-applications.md b/docs/en/docs/tutorial/bigger-applications.md
index b2d928405..eccdd8aeb 100644
--- a/docs/en/docs/tutorial/bigger-applications.md
+++ b/docs/en/docs/tutorial/bigger-applications.md
@@ -136,7 +136,7 @@ We will now use a simple dependency to read a custom `X-Token` header:
!!! tip
We are using an invented header to simplify this example.
- But in real cases you will get better results using the integrated [Security utilities](./security/index.md){.internal-link target=_blank}.
+ But in real cases you will get better results using the integrated [Security utilities](security/index.md){.internal-link target=_blank}.
## Another module with `APIRouter`
@@ -329,7 +329,7 @@ The section:
from .routers import items, users
```
-Means:
+means:
* Starting in the same package that this module (the file `app/main.py`) lives in (the directory `app/`)...
* look for the subpackage `routers` (the directory at `app/routers/`)...
@@ -373,7 +373,7 @@ from .routers.items import router
from .routers.users import router
```
-The `router` from `users` would overwrite the one from `items` and we wouldn't be able to use them at the same time.
+the `router` from `users` would overwrite the one from `items` and we wouldn't be able to use them at the same time.
So, to be able to use both of them in the same file, we import the submodules directly:
diff --git a/docs/en/docs/tutorial/body-updates.md b/docs/en/docs/tutorial/body-updates.md
index 39d133c55..3ba2632d8 100644
--- a/docs/en/docs/tutorial/body-updates.md
+++ b/docs/en/docs/tutorial/body-updates.md
@@ -48,7 +48,7 @@ You can also use the I/O.
-Aún así, en ambas situaciones, es probable que **FastAPI** sea [aún más rápido](index.md#performance){.Internal-link target=_blank} que (o al menos comparable) a tu framework anterior.
+Aún así, en ambas situaciones, es probable que **FastAPI** sea [aún más rápido](index.md#rendimiento){.Internal-link target=_blank} que (o al menos comparable) a tu framework anterior.
### Dependencias
diff --git a/docs/es/docs/index.md b/docs/es/docs/index.md
index b3d9c8bf2..9fc275caf 100644
--- a/docs/es/docs/index.md
+++ b/docs/es/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -443,12 +452,12 @@ Usados por Starlette:
*
itsdangerous
- Requerido para dar soporte a `SessionMiddleware`.
*
pyyaml
- Requerido para dar soporte al `SchemaGenerator` de Starlette (probablemente no lo necesites con FastAPI).
*
graphene
- Requerido para dar soporte a `GraphQLApp`.
-*
ujson
- Requerido si quieres usar `UJSONResponse`.
Usado por FastAPI / Starlette:
*
uvicorn
- para el servidor que carga y sirve tu aplicación.
*
orjson
- Requerido si quieres usar `ORJSONResponse`.
+*
ujson
- Requerido si quieres usar `UJSONResponse`.
Puedes instalarlos con `pip install fastapi[all]`.
diff --git a/docs/es/docs/tutorial/first-steps.md b/docs/es/docs/tutorial/first-steps.md
index 2cb7e6308..c37ce00fb 100644
--- a/docs/es/docs/tutorial/first-steps.md
+++ b/docs/es/docs/tutorial/first-steps.md
@@ -310,7 +310,7 @@ También podrías definirla como una función estándar en lugar de `async def`:
```
!!! note "Nota"
- Si no sabes la diferencia, revisa el [Async: *"¿Tienes prisa?"*](../async.md#in-a-hurry){.internal-link target=_blank}.
+ Si no sabes la diferencia, revisa el [Async: *"¿Tienes prisa?"*](../async.md#tienes-prisa){.internal-link target=_blank}.
### Paso 5: devuelve el contenido
diff --git a/docs/es/docs/tutorial/index.md b/docs/es/docs/tutorial/index.md
index f0dff02b4..f11820ef2 100644
--- a/docs/es/docs/tutorial/index.md
+++ b/docs/es/docs/tutorial/index.md
@@ -50,7 +50,7 @@ $ pip install "fastapi[all]"
...eso también incluye `uvicorn` que puedes usar como el servidor que ejecuta tu código.
-!!! nota
+!!! note "Nota"
También puedes instalarlo parte por parte.
Esto es lo que probablemente harías una vez que desees implementar tu aplicación en producción:
diff --git a/docs/es/docs/tutorial/query-params.md b/docs/es/docs/tutorial/query-params.md
index 482af8dc0..76dc331a9 100644
--- a/docs/es/docs/tutorial/query-params.md
+++ b/docs/es/docs/tutorial/query-params.md
@@ -194,4 +194,4 @@ En este caso hay 3 parámetros de query:
* `limit`, un `int` opcional.
!!! tip "Consejo"
- También podrías usar los `Enum`s de la misma manera que con los [Parámetros de path](path-params.md#predefined-values){.internal-link target=_blank}.
+ También podrías usar los `Enum`s de la misma manera que con los [Parámetros de path](path-params.md#valores-predefinidos){.internal-link target=_blank}.
diff --git a/docs/fa/docs/advanced/sub-applications.md b/docs/fa/docs/advanced/sub-applications.md
index f3a948414..6f2359b94 100644
--- a/docs/fa/docs/advanced/sub-applications.md
+++ b/docs/fa/docs/advanced/sub-applications.md
@@ -69,4 +69,4 @@ $ uvicorn main:app --reload
و زیر برنامه ها نیز می تواند زیر برنامه های متصل شده خود را داشته باشد و همه چیز به درستی کار کند، زیرا FastAPI تمام این مسیرهای `root_path` را به طور خودکار مدیریت می کند.
-در بخش [پشت پراکسی](./behind-a-proxy.md){.internal-link target=_blank}. درباره `root_path` و نحوه استفاده درست از آن بیشتر خواهید آموخت.
+در بخش [پشت پراکسی](behind-a-proxy.md){.internal-link target=_blank}. درباره `root_path` و نحوه استفاده درست از آن بیشتر خواهید آموخت.
diff --git a/docs/fa/docs/index.md b/docs/fa/docs/index.md
index e5231ec8d..623bc0f75 100644
--- a/docs/fa/docs/index.md
+++ b/docs/fa/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -30,7 +39,7 @@ FastAPI یک وب فریمورک مدرن و سریع (با کارایی با
ویژگیهای کلیدی این فریمورک عبارتند از:
-* **
سرعت**: کارایی بسیار بالا و قابل مقایسه با **NodeJS** و **Go** (با تشکر از Starlette و Pydantic). [یکی از سریعترین فریمورکهای پایتونی موجود](#performance).
+* **
سرعت**: کارایی بسیار بالا و قابل مقایسه با **NodeJS** و **Go** (با تشکر از Starlette و Pydantic). [یکی از سریعترین فریمورکهای پایتونی موجود](#_10).
* **
کدنویسی سریع**: افزایش ۲۰۰ تا ۳۰۰ درصدی سرعت توسعه قابلیتهای جدید. *
* **
باگ کمتر**: کاهش ۴۰ درصدی خطاهای انسانی (برنامهنویسی). *
@@ -447,12 +456,12 @@ item: Item
*
itsdangerous
- در صورتی که بخواید از `SessionMiddleware` پشتیبانی کنید.
*
pyyaml
- برای پشتیبانی `SchemaGenerator` در Starlet (به احتمال زیاد برای کار کردن با FastAPI به آن نیازی پیدا نمیکنید).
*
graphene
- در صورتی که از `GraphQLApp` پشتیبانی میکنید.
-*
ujson
- در صورتی که بخواهید از `UJSONResponse` استفاده کنید.
استفاده شده توسط FastAPI / Starlette:
*
uvicorn
- برای سرور اجرا کننده برنامه وب.
*
orjson
- در صورتی که بخواهید از `ORJSONResponse` استفاده کنید.
+*
ujson
- در صورتی که بخواهید از `UJSONResponse` استفاده کنید.
میتوان همه این موارد را با استفاده از دستور `pip install fastapi[all]`. به صورت یکجا نصب کرد.
diff --git a/docs/fr/docs/advanced/additional-responses.md b/docs/fr/docs/advanced/additional-responses.md
index 35b57594d..685a054ad 100644
--- a/docs/fr/docs/advanced/additional-responses.md
+++ b/docs/fr/docs/advanced/additional-responses.md
@@ -1,6 +1,6 @@
# Réponses supplémentaires dans OpenAPI
-!!! Attention
+!!! warning "Attention"
Ceci concerne un sujet plutôt avancé.
Si vous débutez avec **FastAPI**, vous n'en aurez peut-être pas besoin.
@@ -27,10 +27,10 @@ Par exemple, pour déclarer une autre réponse avec un code HTTP `404` et un mod
{!../../../docs_src/additional_responses/tutorial001.py!}
```
-!!! Remarque
+!!! note "Remarque"
Gardez à l'esprit que vous devez renvoyer directement `JSONResponse`.
-!!! Info
+!!! info
La clé `model` ne fait pas partie d'OpenAPI.
**FastAPI** prendra le modèle Pydantic à partir de là, générera le `JSON Schema` et le placera au bon endroit.
@@ -172,10 +172,10 @@ Par exemple, vous pouvez ajouter un type de média supplémentaire `image/png`,
{!../../../docs_src/additional_responses/tutorial002.py!}
```
-!!! Remarque
+!!! note "Remarque"
Notez que vous devez retourner l'image en utilisant directement un `FileResponse`.
-!!! Info
+!!! info
À moins que vous ne spécifiiez explicitement un type de média différent dans votre paramètre `responses`, FastAPI supposera que la réponse a le même type de média que la classe de réponse principale (par défaut `application/json`).
Mais si vous avez spécifié une classe de réponse personnalisée avec `None` comme type de média, FastAPI utilisera `application/json` pour toute réponse supplémentaire associée à un modèle.
@@ -206,7 +206,7 @@ Vous voulez peut-être avoir des réponses prédéfinies qui s'appliquent à de
Dans ces cas, vous pouvez utiliser la technique Python "d'affection par décomposition" (appelé _unpacking_ en anglais) d'un `dict` avec `**dict_to_unpack` :
-``` Python
+```Python
old_dict = {
"old key": "old value",
"second old key": "second old value",
@@ -216,7 +216,7 @@ new_dict = {**old_dict, "new key": "new value"}
Ici, `new_dict` contiendra toutes les paires clé-valeur de `old_dict` plus la nouvelle paire clé-valeur :
-``` Python
+```Python
{
"old key": "old value",
"second old key": "second old value",
diff --git a/docs/fr/docs/advanced/additional-status-codes.md b/docs/fr/docs/advanced/additional-status-codes.md
index e7b003707..51f0db737 100644
--- a/docs/fr/docs/advanced/additional-status-codes.md
+++ b/docs/fr/docs/advanced/additional-status-codes.md
@@ -18,7 +18,7 @@ Pour y parvenir, importez `JSONResponse` et renvoyez-y directement votre contenu
{!../../../docs_src/additional_status_codes/tutorial001.py!}
```
-!!! Attention
+!!! warning "Attention"
Lorsque vous renvoyez une `Response` directement, comme dans l'exemple ci-dessus, elle sera renvoyée directement.
Elle ne sera pas sérialisée avec un modèle.
diff --git a/docs/fr/docs/advanced/index.md b/docs/fr/docs/advanced/index.md
index aa37f1806..4599bcb6f 100644
--- a/docs/fr/docs/advanced/index.md
+++ b/docs/fr/docs/advanced/index.md
@@ -6,7 +6,7 @@ Le [Tutoriel - Guide de l'utilisateur](../tutorial/index.md){.internal-link targ
Dans les sections suivantes, vous verrez des options, configurations et fonctionnalités supplémentaires.
-!!! Note
+!!! note "Remarque"
Les sections de ce chapitre ne sont **pas nécessairement "avancées"**.
Et il est possible que pour votre cas d'utilisation, la solution se trouve dans l'un d'entre eux.
diff --git a/docs/fr/docs/advanced/path-operation-advanced-configuration.md b/docs/fr/docs/advanced/path-operation-advanced-configuration.md
index 7ded97ce1..77f551aea 100644
--- a/docs/fr/docs/advanced/path-operation-advanced-configuration.md
+++ b/docs/fr/docs/advanced/path-operation-advanced-configuration.md
@@ -2,7 +2,7 @@
## ID d'opération OpenAPI
-!!! Attention
+!!! warning "Attention"
Si vous n'êtes pas un "expert" en OpenAPI, vous n'en avez probablement pas besoin.
Dans OpenAPI, les chemins sont des ressources, tels que /users/ ou /items/, exposées par votre API, et les opérations sont les méthodes HTTP utilisées pour manipuler ces chemins, telles que GET, POST ou DELETE. Les operationId sont des chaînes uniques facultatives utilisées pour identifier une opération d'un chemin. Vous pouvez définir l'OpenAPI `operationId` à utiliser dans votre *opération de chemin* avec le paramètre `operation_id`.
@@ -23,10 +23,10 @@ Vous devriez le faire après avoir ajouté toutes vos *paramètres de chemin*.
{!../../../docs_src/path_operation_advanced_configuration/tutorial002.py!}
```
-!!! Astuce
+!!! tip "Astuce"
Si vous appelez manuellement `app.openapi()`, vous devez mettre à jour les `operationId` avant.
-!!! Attention
+!!! warning "Attention"
Pour faire cela, vous devez vous assurer que chacun de vos *chemin* ait un nom unique.
Même s'ils se trouvent dans des modules différents (fichiers Python).
@@ -59,7 +59,7 @@ Cela définit les métadonnées sur la réponse principale d'une *opération de
Vous pouvez également déclarer des réponses supplémentaires avec leurs modèles, codes de statut, etc.
-Il y a un chapitre entier ici dans la documentation à ce sujet, vous pouvez le lire sur [Réponses supplémentaires dans OpenAPI](./additional-responses.md){.internal-link target=_blank}.
+Il y a un chapitre entier ici dans la documentation à ce sujet, vous pouvez le lire sur [Réponses supplémentaires dans OpenAPI](additional-responses.md){.internal-link target=_blank}.
## OpenAPI supplémentaire
@@ -74,8 +74,8 @@ Il inclut les `tags`, `parameters`, `requestBody`, `responses`, etc.
Ce schéma OpenAPI spécifique aux *operations* est normalement généré automatiquement par **FastAPI**, mais vous pouvez également l'étendre.
-!!! Astuce
- Si vous avez seulement besoin de déclarer des réponses supplémentaires, un moyen plus pratique de le faire est d'utiliser les [réponses supplémentaires dans OpenAPI](./additional-responses.md){.internal-link target=_blank}.
+!!! tip "Astuce"
+ Si vous avez seulement besoin de déclarer des réponses supplémentaires, un moyen plus pratique de le faire est d'utiliser les [réponses supplémentaires dans OpenAPI](additional-responses.md){.internal-link target=_blank}.
Vous pouvez étendre le schéma OpenAPI pour une *opération de chemin* en utilisant le paramètre `openapi_extra`.
@@ -162,7 +162,7 @@ Et nous analysons directement ce contenu YAML, puis nous utilisons à nouveau le
{!../../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
```
-!!! Astuce
+!!! tip "Astuce"
Ici, nous réutilisons le même modèle Pydantic.
Mais nous aurions pu tout aussi bien pu le valider d'une autre manière.
diff --git a/docs/fr/docs/advanced/response-directly.md b/docs/fr/docs/advanced/response-directly.md
index 1c923fb82..ed29446d4 100644
--- a/docs/fr/docs/advanced/response-directly.md
+++ b/docs/fr/docs/advanced/response-directly.md
@@ -14,7 +14,7 @@ Cela peut être utile, par exemple, pour retourner des en-têtes personnalisés
En fait, vous pouvez retourner n'importe quelle `Response` ou n'importe quelle sous-classe de celle-ci.
-!!! Note
+!!! note "Remarque"
`JSONResponse` est elle-même une sous-classe de `Response`.
Et quand vous retournez une `Response`, **FastAPI** la transmet directement.
diff --git a/docs/fr/docs/fastapi-people.md b/docs/fr/docs/fastapi-people.md
index 275a9bd37..d99dcd9c2 100644
--- a/docs/fr/docs/fastapi-people.md
+++ b/docs/fr/docs/fastapi-people.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# La communauté FastAPI
FastAPI a une communauté extraordinaire qui accueille des personnes de tous horizons.
@@ -18,7 +23,7 @@ C'est moi :
{% endif %}
-Je suis le créateur et le responsable de **FastAPI**. Vous pouvez en lire plus à ce sujet dans [Aide FastAPI - Obtenir de l'aide - Se rapprocher de l'auteur](help-fastapi.md#connect-with-the-author){.internal-link target=_blank}.
+Je suis le créateur et le responsable de **FastAPI**. Vous pouvez en lire plus à ce sujet dans [Aide FastAPI - Obtenir de l'aide - Se rapprocher de l'auteur](help-fastapi.md#se-rapprocher-de-lauteur){.internal-link target=_blank}.
...Mais ici, je veux vous montrer la communauté.
@@ -28,15 +33,15 @@ Je suis le créateur et le responsable de **FastAPI**. Vous pouvez en lire plus
Ce sont ces personnes qui :
-* [Aident les autres à résoudre des problèmes (questions) dans GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}.
-* [Créent des Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
-* Review les Pull Requests, [particulièrement important pour les traductions](contributing.md#translations){.internal-link target=_blank}.
+* [Aident les autres à résoudre des problèmes (questions) dans GitHub](help-fastapi.md#aider-les-autres-a-resoudre-les-problemes-dans-github){.internal-link target=_blank}.
+* [Créent des Pull Requests](help-fastapi.md#creer-une-pull-request){.internal-link target=_blank}.
+* Review les Pull Requests, [particulièrement important pour les traductions](contributing.md#traductions){.internal-link target=_blank}.
Une salve d'applaudissements pour eux. 👏 🙇
## Utilisateurs les plus actifs le mois dernier
-Ce sont les utilisateurs qui ont [aidé le plus les autres avec des problèmes (questions) dans GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} au cours du dernier mois. ☕
+Ce sont les utilisateurs qui ont [aidé le plus les autres avec des problèmes (questions) dans GitHub](help-fastapi.md#aider-les-autres-a-resoudre-les-problemes-dans-github){.internal-link target=_blank} au cours du dernier mois. ☕
{% if people %}
@@ -52,7 +57,7 @@ Ce sont les utilisateurs qui ont [aidé le plus les autres avec des problèmes (
Voici les **Experts FastAPI**. 🤓
-Ce sont les utilisateurs qui ont [aidé le plus les autres avec des problèmes (questions) dans GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} depuis *toujours*.
+Ce sont les utilisateurs qui ont [aidé le plus les autres avec des problèmes (questions) dans GitHub](help-fastapi.md#aider-les-autres-a-resoudre-les-problemes-dans-github){.internal-link target=_blank} depuis *toujours*.
Ils ont prouvé qu'ils étaient des experts en aidant beaucoup d'autres personnes. ✨
@@ -70,7 +75,7 @@ Ils ont prouvé qu'ils étaient des experts en aidant beaucoup d'autres personne
Ces utilisateurs sont les **Principaux contributeurs**. 👷
-Ces utilisateurs ont [créé le plus grand nombre de demandes Pull Request](help-fastapi.md#create-a-pull-request){.internal-link target=_blank} qui ont été *merged*.
+Ces utilisateurs ont [créé le plus grand nombre de demandes Pull Request](help-fastapi.md#creer-une-pull-request){.internal-link target=_blank} qui ont été *merged*.
Ils ont contribué au code source, à la documentation, aux traductions, etc. 📦
@@ -92,7 +97,7 @@ Ces utilisateurs sont les **Principaux Reviewers**. 🕵️
### Reviewers des traductions
-Je ne parle que quelques langues (et pas très bien 😅). Ainsi, les reviewers sont ceux qui ont le [**pouvoir d'approuver les traductions**](contributing.md#translations){.internal-link target=_blank} de la documentation. Sans eux, il n'y aurait pas de documentation dans plusieurs autres langues.
+Je ne parle que quelques langues (et pas très bien 😅). Ainsi, les reviewers sont ceux qui ont le [**pouvoir d'approuver les traductions**](contributing.md#traductions){.internal-link target=_blank} de la documentation. Sans eux, il n'y aurait pas de documentation dans plusieurs autres langues.
---
diff --git a/docs/fr/docs/features.md b/docs/fr/docs/features.md
index 1457df2a5..da1c70df9 100644
--- a/docs/fr/docs/features.md
+++ b/docs/fr/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Fonctionnalités
## Fonctionnalités de FastAPI
diff --git a/docs/fr/docs/index.md b/docs/fr/docs/index.md
index bc3ae3c06..324681a74 100644
--- a/docs/fr/docs/index.md
+++ b/docs/fr/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -454,12 +463,12 @@ Utilisées par Starlette :
*
python-multipart
- Obligatoire si vous souhaitez supporter le
"décodage" de formulaire avec `request.form()`.
*
itsdangerous
- Obligatoire pour la prise en charge de `SessionMiddleware`.
*
pyyaml
- Obligatoire pour le support `SchemaGenerator` de Starlette (vous n'en avez probablement pas besoin avec FastAPI).
-*
ujson
- Obligatoire si vous souhaitez utiliser `UJSONResponse`.
Utilisées par FastAPI / Starlette :
*
uvicorn
- Pour le serveur qui charge et sert votre application.
*
orjson
- Obligatoire si vous voulez utiliser `ORJSONResponse`.
+*
ujson
- Obligatoire si vous souhaitez utiliser `UJSONResponse`.
Vous pouvez tout installer avec `pip install fastapi[all]`.
diff --git a/docs/fr/docs/tutorial/path-params.md b/docs/fr/docs/tutorial/path-params.md
index 817545c1c..523e2c8c2 100644
--- a/docs/fr/docs/tutorial/path-params.md
+++ b/docs/fr/docs/tutorial/path-params.md
@@ -28,7 +28,7 @@ Vous pouvez déclarer le type d'un paramètre de chemin dans la fonction, en uti
Ici, `item_id` est déclaré comme `int`.
-!!! hint "Astuce"
+!!! check "vérifier"
Ceci vous permettra d'obtenir des fonctionnalités de l'éditeur dans votre fonction, telles
que des vérifications d'erreur, de l'auto-complétion, etc.
@@ -40,7 +40,7 @@ Si vous exécutez cet exemple et allez sur
http://127.0.0.1:8000/items/4.2.
-!!! hint "Astuce"
+!!! check "vérifier"
Donc, avec ces mêmes déclarations de type Python, **FastAPI** vous fournit de la validation de données.
Notez que l'erreur mentionne le point exact où la validation n'a pas réussi.
diff --git a/docs/he/docs/index.md b/docs/he/docs/index.md
index 335a22743..621126128 100644
--- a/docs/he/docs/index.md
+++ b/docs/he/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -31,7 +40,7 @@ FastAPI היא תשתית רשת מודרנית ומהירה (ביצועים ג
תכונות המפתח הן:
-- **מהירה**: ביצועים גבוהים מאוד, בקנה אחד עם NodeJS ו - Go (תודות ל - Starlette ו - Pydantic). [אחת מתשתיות הפייתון המהירות ביותר](#performance).
+- **מהירה**: ביצועים גבוהים מאוד, בקנה אחד עם NodeJS ו - Go (תודות ל - Starlette ו - Pydantic). [אחת מתשתיות הפייתון המהירות ביותר](#_14).
- **מהירה לתכנות**: הגבירו את מהירות פיתוח התכונות החדשות בכ - %200 עד %300. \*
- **פחות שגיאות**: מנעו כ - %40 משגיאות אנוש (מפתחים). \*
@@ -449,12 +458,12 @@ item: Item
-
python-multipart
- דרוש אם ברצונכם לתמוך ב
"פרסור" טפסים, באצמעות
request.form()
.
-
itsdangerous
- דרוש אם ברצונכם להשתמש ב - `SessionMiddleware`.
-
pyyaml
- דרוש אם ברצונכם להשתמש ב - `SchemaGenerator` של Starlette (כנראה שאתם לא צריכים את זה עם FastAPI).
--
ujson
- דרוש אם ברצונכם להשתמש ב - `UJSONResponse`.
בשימוש FastAPI / Starlette:
-
uvicorn
- לשרת שטוען ומגיש את האפליקציה שלכם.
-
orjson
- דרוש אם ברצונכם להשתמש ב - `ORJSONResponse`.
+-
ujson
- דרוש אם ברצונכם להשתמש ב - `UJSONResponse`.
תוכלו להתקין את כל אלו באמצעות
pip install "fastapi[all]"
.
diff --git a/docs/hu/docs/index.md b/docs/hu/docs/index.md
index 75ea88c4d..896db6d1f 100644
--- a/docs/hu/docs/index.md
+++ b/docs/hu/docs/index.md
@@ -456,12 +456,12 @@ Starlette által használt:
*
python-multipart
- Követelmény ha
"parsing"-ot akarsz támogatni, `request.form()`-al.
*
itsdangerous
- Követelmény `SessionMiddleware` támogatáshoz.
*
pyyaml
- Követelmény a Starlette `SchemaGenerator`-ának támogatásához (valószínűleg erre nincs szükség FastAPI használása esetén).
-*
ujson
- Követelmény ha `UJSONResponse`-t akarsz használni.
FastAPI / Starlette által használt
*
uvicorn
- Szerverekhez amíg betöltik és szolgáltatják az applikációdat.
*
orjson
- Követelmény ha `ORJSONResponse`-t akarsz használni.
+*
ujson
- Követelmény ha `UJSONResponse`-t akarsz használni.
Ezeket mind telepítheted a `pip install "fastapi[all]"` paranccsal.
diff --git a/docs/id/docs/tutorial/index.md b/docs/id/docs/tutorial/index.md
index b8ed96ae1..6b6de24f0 100644
--- a/docs/id/docs/tutorial/index.md
+++ b/docs/id/docs/tutorial/index.md
@@ -52,7 +52,7 @@ $ pip install "fastapi[all]"
...yang juga termasuk `uvicorn`, yang dapat kamu gunakan sebagai server yang menjalankan kodemu.
-!!! catatan
+!!! note "Catatan"
Kamu juga dapat meng-installnya bagian demi bagian.
Hal ini mungkin yang akan kamu lakukan ketika kamu hendak menyebarkan (men-deploy) aplikasimu ke tahap produksi:
diff --git a/docs/it/docs/index.md b/docs/it/docs/index.md
index a69008d2b..c06d3a174 100644
--- a/docs/it/docs/index.md
+++ b/docs/it/docs/index.md
@@ -438,7 +438,6 @@ Per approfondire, consulta la sezione
ujson
- per un
"parsing" di JSON più veloce.
*
email_validator
- per la validazione di email.
Usate da Starlette:
@@ -450,12 +449,12 @@ Usate da Starlette:
*
itsdangerous
- Richiesto per usare `SessionMiddleware`.
*
pyyaml
- Richiesto per il supporto dello `SchemaGenerator` di Starlette (probabilmente non ti serve con FastAPI).
*
graphene
- Richiesto per il supporto di `GraphQLApp`.
-*
ujson
- Richiesto se vuoi usare `UJSONResponse`.
Usate da FastAPI / Starlette:
*
uvicorn
- per il server che carica e serve la tua applicazione.
*
orjson
- ichiesto se vuoi usare `ORJSONResponse`.
+*
ujson
- Richiesto se vuoi usare `UJSONResponse`.
Puoi installarle tutte con `pip install fastapi[all]`.
diff --git a/docs/ja/docs/async.md b/docs/ja/docs/async.md
index 934cea0ef..5e38d1cec 100644
--- a/docs/ja/docs/async.md
+++ b/docs/ja/docs/async.md
@@ -368,7 +368,7 @@ async def read_burgers():
上記の方法と違った方法の別の非同期フレームワークから来ており、小さなパフォーマンス向上 (約100ナノ秒) のために通常の `def` を使用して些細な演算のみ行う *path operation 関数* を定義するのに慣れている場合は、**FastAPI**ではまったく逆の効果になることに注意してください。このような場合、*path operation 関数* がブロッキング
I/Oを実行しないのであれば、`async def` の使用をお勧めします。
-それでも、どちらの状況でも、**FastAPI**が過去のフレームワークよりも (またはそれに匹敵するほど) [高速になる](index.md#performance){.internal-link target=_blank}可能性があります。
+それでも、どちらの状況でも、**FastAPI**が過去のフレームワークよりも (またはそれに匹敵するほど) [高速になる](index.md#_10){.internal-link target=_blank}可能性があります。
### 依存関係
@@ -390,4 +390,4 @@ async def read_burgers():
繰り返しになりますが、これらは非常に技術的な詳細であり、検索して辿り着いた場合は役立つでしょう。
-それ以外の場合は、上記のセクションのガイドラインで問題ないはずです:
急いでいますか?。
+それ以外の場合は、上記のセクションのガイドラインで問題ないはずです:
急いでいますか?。
diff --git a/docs/ja/docs/deployment/concepts.md b/docs/ja/docs/deployment/concepts.md
index 38cbca219..abe4f2c66 100644
--- a/docs/ja/docs/deployment/concepts.md
+++ b/docs/ja/docs/deployment/concepts.md
@@ -30,7 +30,7 @@
## セキュリティ - HTTPS
-[前チャプターのHTTPSについて](./https.md){.internal-link target=_blank}では、HTTPSがどのようにAPIを暗号化するのかについて学びました。
+[前チャプターのHTTPSについて](https.md){.internal-link target=_blank}では、HTTPSがどのようにAPIを暗号化するのかについて学びました。
通常、アプリケーションサーバにとって**外部の**コンポーネントである**TLS Termination Proxy**によって提供されることが一般的です。このプロキシは通信の暗号化を担当します。
@@ -188,7 +188,7 @@ FastAPI アプリケーションでは、Uvicorn のようなサーバープロ
### ワーカー・プロセス と ポート
-[HTTPSについて](./https.md){.internal-link target=_blank}のドキュメントで、1つのサーバーで1つのポートとIPアドレスの組み合わせでリッスンできるのは1つのプロセスだけであることを覚えていますでしょうか?
+[HTTPSについて](https.md){.internal-link target=_blank}のドキュメントで、1つのサーバーで1つのポートとIPアドレスの組み合わせでリッスンできるのは1つのプロセスだけであることを覚えていますでしょうか?
これはいまだに同じです。
@@ -247,7 +247,7 @@ FastAPI アプリケーションでは、Uvicorn のようなサーバープロ
これらの**コンテナ**やDockerそしてKubernetesに関する項目が、まだあまり意味をなしていなくても心配しないでください。
- コンテナ・イメージ、Docker、Kubernetesなどについては、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](./docker.md){.internal-link target=_blank}.
+ コンテナ・イメージ、Docker、Kubernetesなどについては、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}.
## 開始前の事前のステップ
@@ -282,7 +282,7 @@ FastAPI アプリケーションでは、Uvicorn のようなサーバープロ
!!! tip
- コンテナを使った具体的な例については、次の章で紹介します: [コンテナ内のFastAPI - Docker](./docker.md){.internal-link target=_blank}.
+ コンテナを使った具体的な例については、次の章で紹介します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}.
## リソースの利用
diff --git a/docs/ja/docs/deployment/docker.md b/docs/ja/docs/deployment/docker.md
index ca9dedc3c..0c9df648d 100644
--- a/docs/ja/docs/deployment/docker.md
+++ b/docs/ja/docs/deployment/docker.md
@@ -117,7 +117,7 @@ FastAPI用の**Dockerイメージ**を、**公式Python**イメージに基づ
最も一般的な方法は、`requirements.txt` ファイルにパッケージ名とそのバージョンを 1 行ずつ書くことです。
-もちろん、[FastAPI バージョンについて](./versions.md){.internal-link target=_blank}で読んだのと同じアイデアを使用して、バージョンの範囲を設定します。
+もちろん、[FastAPI バージョンについて](versions.md){.internal-link target=_blank}で読んだのと同じアイデアを使用して、バージョンの範囲を設定します。
例えば、`requirements.txt` は次のようになります:
@@ -384,7 +384,7 @@ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
## デプロイメントのコンセプト
-コンテナという観点から、[デプロイのコンセプト](./concepts.md){.internal-link target=_blank}に共通するいくつかについて、もう一度説明しましょう。
+コンテナという観点から、[デプロイのコンセプト](concepts.md){.internal-link target=_blank}に共通するいくつかについて、もう一度説明しましょう。
コンテナは主に、アプリケーションの**ビルドとデプロイ**のプロセスを簡素化するためのツールですが、これらの**デプロイのコンセプト**を扱うための特定のアプローチを強制するものではないです。
@@ -461,7 +461,7 @@ Kubernetesのような分散コンテナ管理システムの1つは通常、入
もちろん、**特殊なケース**として、**Gunicornプロセスマネージャ**を持つ**コンテナ**内で複数の**Uvicornワーカープロセス**を起動させたい場合があります。
-このような場合、**公式のDockerイメージ**を使用することができます。このイメージには、複数の**Uvicornワーカープロセス**を実行するプロセスマネージャとして**Gunicorn**が含まれており、現在のCPUコアに基づいてワーカーの数を自動的に調整するためのデフォルト設定がいくつか含まれています。詳しくは後述の[Gunicornによる公式Dockerイメージ - Uvicorn](#gunicornによる公式dockerイメージ---Uvicorn)で説明します。
+このような場合、**公式のDockerイメージ**を使用することができます。このイメージには、複数の**Uvicornワーカープロセス**を実行するプロセスマネージャとして**Gunicorn**が含まれており、現在のCPUコアに基づいてワーカーの数を自動的に調整するためのデフォルト設定がいくつか含まれています。詳しくは後述の[Gunicornによる公式Dockerイメージ - Uvicorn](#gunicorndocker-uvicorn)で説明します。
以下は、それが理にかなっている場合の例です:
@@ -531,7 +531,7 @@ Docker Composeで**シングルサーバ**(クラスタではない)にデ
## Gunicornによる公式Dockerイメージ - Uvicorn
-前の章で詳しく説明したように、Uvicornワーカーで動作するGunicornを含む公式のDockerイメージがあります: [Server Workers - Gunicorn と Uvicorn](./server-workers.md){.internal-link target=_blank}で詳しく説明しています。
+前の章で詳しく説明したように、Uvicornワーカーで動作するGunicornを含む公式のDockerイメージがあります: [Server Workers - Gunicorn と Uvicorn](server-workers.md){.internal-link target=_blank}で詳しく説明しています。
このイメージは、主に上記で説明した状況で役に立つでしょう: [複数のプロセスと特殊なケースを持つコンテナ(Containers with Multiple Processes and Special Cases)](#containers-with-multiple-processes-and-special-cases)
diff --git a/docs/ja/docs/deployment/server-workers.md b/docs/ja/docs/deployment/server-workers.md
index e1ea165a2..51d0bc2d4 100644
--- a/docs/ja/docs/deployment/server-workers.md
+++ b/docs/ja/docs/deployment/server-workers.md
@@ -13,13 +13,13 @@
アプリケーションをデプロイする際には、**複数のコア**を利用し、そしてより多くのリクエストを処理できるようにするために、プロセスの**レプリケーション**を持つことを望むでしょう。
-前のチャプターである[デプロイメントのコンセプト](./concepts.md){.internal-link target=_blank}にて見てきたように、有効な戦略がいくつかあります。
+前のチャプターである[デプロイメントのコンセプト](concepts.md){.internal-link target=_blank}にて見てきたように、有効な戦略がいくつかあります。
ここでは
**Gunicorn**が**Uvicornのワーカー・プロセス**を管理する場合の使い方について紹介していきます。
!!! info
- DockerやKubernetesなどのコンテナを使用している場合は、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](./docker.md){.internal-link target=_blank}
+ DockerやKubernetesなどのコンテナを使用している場合は、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}
特に**Kubernetes**上で実行する場合は、おそらく**Gunicornを使用せず**、**コンテナごとに単一のUvicornプロセス**を実行することになりますが、それについてはこの章の後半で説明します。
@@ -167,7 +167,7 @@ $ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
## コンテナとDocker
-次章の[コンテナ内のFastAPI - Docker](./docker.md){.internal-link target=_blank}では、その他の**デプロイのコンセプト**を扱うために実施するであろう戦略をいくつか紹介します。
+次章の[コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}では、その他の**デプロイのコンセプト**を扱うために実施するであろう戦略をいくつか紹介します。
また、**GunicornとUvicornワーカー**を含む**公式Dockerイメージ**と、簡単なケースに役立ついくつかのデフォルト設定も紹介します。
diff --git a/docs/ja/docs/fastapi-people.md b/docs/ja/docs/fastapi-people.md
index ff75dcbce..d92a7bf46 100644
--- a/docs/ja/docs/fastapi-people.md
+++ b/docs/ja/docs/fastapi-people.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# FastAPI People
FastAPIには、様々なバックグラウンドの人々を歓迎する素晴らしいコミュニティがあります。
@@ -19,7 +24,7 @@ FastAPIには、様々なバックグラウンドの人々を歓迎する素晴
{% endif %}
-私は **FastAPI** の作成者および Maintainer です。詳しくは [FastAPIを応援 - ヘルプの入手 - 開発者とつながる](help-fastapi.md#開発者とつながる){.internal-link target=_blank} に記載しています。
+私は **FastAPI** の作成者および Maintainer です。詳しくは [FastAPIを応援 - ヘルプの入手 - 開発者とつながる](help-fastapi.md#_1){.internal-link target=_blank} に記載しています。
...ところで、ここではコミュニティを紹介したいと思います。
@@ -29,15 +34,15 @@ FastAPIには、様々なバックグラウンドの人々を歓迎する素晴
紹介するのは次のような人々です:
-* [GitHub issuesで他の人を助ける](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}。
+* [GitHub issuesで他の人を助ける](help-fastapi.md#github-issues){.internal-link target=_blank}。
* [プルリクエストをする](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}。
-* プルリクエストのレビューをする ([特に翻訳に重要](contributing.md#translations){.internal-link target=_blank})。
+* プルリクエストのレビューをする ([特に翻訳に重要](contributing.md#_8){.internal-link target=_blank})。
彼らに大きな拍手を。👏 🙇
## 先月最もアクティブだったユーザー
-彼らは、先月の[GitHub issuesで最も多くの人を助けた](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}ユーザーです。☕
+彼らは、先月の[GitHub issuesで最も多くの人を助けた](help-fastapi.md#github-issues){.internal-link target=_blank}ユーザーです。☕
{% if people %}
@@ -53,7 +58,7 @@ FastAPIには、様々なバックグラウンドの人々を歓迎する素晴
**FastAPI experts** を紹介します。🤓
-彼らは、*これまでに* [GitHub issuesで最も多くの人を助けた](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}ユーザーです。
+彼らは、*これまでに* [GitHub issuesで最も多くの人を助けた](help-fastapi.md#github-issues){.internal-link target=_blank}ユーザーです。
多くの人を助けることでexpertsであると示されています。✨
@@ -93,7 +98,7 @@ FastAPIには、様々なバックグラウンドの人々を歓迎する素晴
### 翻訳のレビュー
-私は少しの言語しか話せません (もしくはあまり上手ではありません😅)。したがって、reviewers は、ドキュメントの[**翻訳を承認する権限**](contributing.md#translations){.internal-link target=_blank}を持っています。それらがなければ、いくつかの言語のドキュメントはなかったでしょう。
+私は少しの言語しか話せません (もしくはあまり上手ではありません😅)。したがって、reviewers は、ドキュメントの[**翻訳を承認する権限**](contributing.md#_8){.internal-link target=_blank}を持っています。それらがなければ、いくつかの言語のドキュメントはなかったでしょう。
---
diff --git a/docs/ja/docs/features.md b/docs/ja/docs/features.md
index 98c59e7c4..64d8758a5 100644
--- a/docs/ja/docs/features.md
+++ b/docs/ja/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# 機能
## FastAPIの機能
diff --git a/docs/ja/docs/index.md b/docs/ja/docs/index.md
index 4f66b1a40..a991222cb 100644
--- a/docs/ja/docs/index.md
+++ b/docs/ja/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -28,7 +37,7 @@ FastAPI は、Pythonの標準である型ヒントに基づいてPython 3.8 以
主な特徴:
-- **高速**: **NodeJS** や **Go** 並みのとても高いパフォーマンス (Starlette と Pydantic のおかげです)。 [最も高速な Python フレームワークの一つです](#performance).
+- **高速**: **NodeJS** や **Go** 並みのとても高いパフォーマンス (Starlette と Pydantic のおかげです)。 [最も高速な Python フレームワークの一つです](#_10).
- **高速なコーディング**: 開発速度を約 200%~300%向上させます。 \*
- **少ないバグ**: 開発者起因のヒューマンエラーを約 40%削減します。 \*
@@ -441,12 +450,12 @@ Starlette によって使用されるもの:
-
itsdangerous
- `SessionMiddleware` サポートのためには必要です。
-
pyyaml
- Starlette の `SchemaGenerator` サポートのために必要です。 (FastAPI では必要ないでしょう。)
-
graphene
- `GraphQLApp` サポートのためには必要です。
--
ujson
- `UJSONResponse`を使用する場合は必須です。
FastAPI / Starlette に使用されるもの:
-
uvicorn
- アプリケーションをロードしてサーブするサーバーのため。
-
orjson
- `ORJSONResponse`を使用したい場合は必要です。
+-
ujson
- `UJSONResponse`を使用する場合は必須です。
これらは全て `pip install fastapi[all]`でインストールできます。
diff --git a/docs/ja/docs/tutorial/body-updates.md b/docs/ja/docs/tutorial/body-updates.md
index 7a56ef2b9..95d328ec5 100644
--- a/docs/ja/docs/tutorial/body-updates.md
+++ b/docs/ja/docs/tutorial/body-updates.md
@@ -34,7 +34,7 @@
つまり、更新したいデータだけを送信して、残りはそのままにしておくことができます。
-!!! Note "備考"
+!!! note "備考"
`PATCH`は`PUT`よりもあまり使われておらず、知られていません。
また、多くのチームは部分的な更新であっても`PUT`だけを使用しています。
diff --git a/docs/ja/docs/tutorial/body.md b/docs/ja/docs/tutorial/body.md
index 12332991d..ccce9484d 100644
--- a/docs/ja/docs/tutorial/body.md
+++ b/docs/ja/docs/tutorial/body.md
@@ -162,4 +162,4 @@ APIはほとんどの場合 **レスポンス** ボディを送らなければ
## Pydanticを使わない方法
-もしPydanticモデルを使用したくない場合は、**Body**パラメータが利用できます。[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}を確認してください。
+もしPydanticモデルを使用したくない場合は、**Body**パラメータが利用できます。[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#_2){.internal-link target=_blank}を確認してください。
diff --git a/docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md
index 2a89e51d2..c0642efd4 100644
--- a/docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md
+++ b/docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -108,7 +108,7 @@ FastAPIは、いくつかの
바쁘신 경우
+## 바쁘신 경우
요약
@@ -263,7 +263,7 @@ CPU에 묶인 연산에 관한 흔한 예시는 복잡한 수학 처리를 필
파이썬이 **데이터 사이언스**, 머신러닝과 특히 딥러닝에 의 주된 언어라는 간단한 사실에 더해서, 이것은 FastAPI를 데이터 사이언스 / 머신러닝 웹 API와 응용프로그램에 (다른 것들보다) 좋은 선택지가 되게 합니다.
-배포시 병렬을 어떻게 가능하게 하는지 알고싶다면, [배포](/ko/deployment){.internal-link target=_blank}문서를 참고하십시오.
+배포시 병렬을 어떻게 가능하게 하는지 알고싶다면, [배포](deployment/index.md){.internal-link target=_blank}문서를 참고하십시오.
## `async`와 `await`
@@ -379,7 +379,7 @@ FastAPI를 사용하지 않더라도, 높은 호환성 및 I/O를 수행하는 코드를 사용하지 않는 한 `async def`를 사용하는 편이 더 낫습니다.
-하지만 두 경우 모두, FastAPI가 당신이 전에 사용하던 프레임워크보다 [더 빠를](index.md#performance){.internal-link target=_blank} (최소한 비견될) 확률이 높습니다.
+하지만 두 경우 모두, FastAPI가 당신이 전에 사용하던 프레임워크보다 [더 빠를](index.md#_11){.internal-link target=_blank} (최소한 비견될) 확률이 높습니다.
### 의존성
@@ -401,4 +401,4 @@ FastAPI를 사용하지 않더라도, 높은 호환성 및
**구니콘**을 **유비콘 워커 프로세스**와 함께 사용하는 방법을 알려드리겠습니다.
-!!! 정보
- 만약 도커와 쿠버네티스 같은 컨테이너를 사용하고 있다면 다음 챕터 [FastAPI와 컨테이너 - 도커](./docker.md){.internal-link target=_blank}에서 더 많은 정보를 얻을 수 있습니다.
+!!! info "정보"
+ 만약 도커와 쿠버네티스 같은 컨테이너를 사용하고 있다면 다음 챕터 [FastAPI와 컨테이너 - 도커](docker.md){.internal-link target=_blank}에서 더 많은 정보를 얻을 수 있습니다.
특히, 쿠버네티스에서 실행할 때는 구니콘을 사용하지 않고 대신 컨테이너당 하나의 유비콘 프로세스를 실행하는 것이 좋습니다. 이 장의 뒷부분에서 설명하겠습니다.
@@ -165,7 +165,7 @@ $ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
## 컨테이너와 도커
-다음 장인 [FastAPI와 컨테이너 - 도커](./docker.md){.internal-link target=_blank}에서 다른 **배포 개념들**을 다루는 전략들을 알려드리겠습니다.
+다음 장인 [FastAPI와 컨테이너 - 도커](docker.md){.internal-link target=_blank}에서 다른 **배포 개념들**을 다루는 전략들을 알려드리겠습니다.
또한 간단한 케이스에서 사용할 수 있는, **구니콘과 유비콘 워커**가 포함돼 있는 **공식 도커 이미지**와 함께 몇 가지 기본 구성을 보여드리겠습니다.
diff --git a/docs/ko/docs/features.md b/docs/ko/docs/features.md
index 54479165e..f7b35557c 100644
--- a/docs/ko/docs/features.md
+++ b/docs/ko/docs/features.md
@@ -68,7 +68,7 @@ second_user_data = {
my_second_user: User = User(**second_user_data)
```
-!!! 정보
+!!! info "정보"
`**second_user_data`가 뜻하는 것:
`second_user_data` 딕셔너리의 키와 값을 키-값 인자로서 바로 넘겨줍니다. 다음과 동일합니다: `User(id=4, name="Mary", joined="2018-11-30")`
diff --git a/docs/ko/docs/index.md b/docs/ko/docs/index.md
index eeadc0363..dea087332 100644
--- a/docs/ko/docs/index.md
+++ b/docs/ko/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -28,7 +37,7 @@ FastAPI는 현대적이고, 빠르며(고성능), 파이썬 표준 타입 힌트
주요 특징으로:
-* **빠름**: (Starlette과 Pydantic 덕분에) **NodeJS** 및 **Go**와 대등할 정도로 매우 높은 성능. [사용 가능한 가장 빠른 파이썬 프레임워크 중 하나](#performance).
+* **빠름**: (Starlette과 Pydantic 덕분에) **NodeJS** 및 **Go**와 대등할 정도로 매우 높은 성능. [사용 가능한 가장 빠른 파이썬 프레임워크 중 하나](#_11).
* **빠른 코드 작성**: 약 200%에서 300%까지 기능 개발 속도 증가. *
* **적은 버그**: 사람(개발자)에 의한 에러 약 40% 감소. *
@@ -447,12 +456,12 @@ Starlette이 사용하는:
*
itsdangerous
- `SessionMiddleware` 지원을 위해 필요.
*
pyyaml
- Starlette의 `SchemaGenerator` 지원을 위해 필요 (FastAPI와 쓸때는 필요 없을 것입니다).
*
graphene
- `GraphQLApp` 지원을 위해 필요.
-*
ujson
- `UJSONResponse`를 사용하려면 필요.
FastAPI / Starlette이 사용하는:
*
uvicorn
- 애플리케이션을 로드하고 제공하는 서버.
*
orjson
- `ORJSONResponse`을 사용하려면 필요.
+*
ujson
- `UJSONResponse`를 사용하려면 필요.
`pip install fastapi[all]`를 통해 이 모두를 설치 할 수 있습니다.
diff --git a/docs/ko/docs/tutorial/body-fields.md b/docs/ko/docs/tutorial/body-fields.md
index fc7209726..c91d6130b 100644
--- a/docs/ko/docs/tutorial/body-fields.md
+++ b/docs/ko/docs/tutorial/body-fields.md
@@ -26,7 +26,7 @@
=== "Python 3.10+ Annotated가 없는 경우"
- !!! 팁
+ !!! tip "팁"
가능하다면 `Annotated`가 달린 버전을 권장합니다.
```Python hl_lines="2"
diff --git a/docs/ko/docs/tutorial/body.md b/docs/ko/docs/tutorial/body.md
index 8b98284bb..0ab8b7162 100644
--- a/docs/ko/docs/tutorial/body.md
+++ b/docs/ko/docs/tutorial/body.md
@@ -8,7 +8,7 @@
**요청** 본문을 선언하기 위해서 모든 강력함과 이점을 갖춘
Pydantic 모델을 사용합니다.
-!!! 정보
+!!! info "정보"
데이터를 보내기 위해, (좀 더 보편적인) `POST`, `PUT`, `DELETE` 혹은 `PATCH` 중에 하나를 사용하는 것이 좋습니다.
`GET` 요청에 본문을 담아 보내는 것은 명세서에 정의되지 않은 행동입니다. 그럼에도 불구하고, 이 방식은 아주 복잡한/극한의 사용 상황에서만 FastAPI에 의해 지원됩니다.
@@ -134,7 +134,7 @@

-!!! 팁
+!!! tip "팁"
만약
PyCharm를 편집기로 사용한다면,
Pydantic PyCharm Plugin을 사용할 수 있습니다.
다음 사항을 포함해 Pydantic 모델에 대한 편집기 지원을 향상시킵니다:
@@ -203,11 +203,11 @@
* 만약 매개변수가 (`int`, `float`, `str`, `bool` 등과 같은) **유일한 타입**으로 되어있으면, **쿼리** 매개변수로 해석될 것입니다.
* 만약 매개변수가 **Pydantic 모델** 타입으로 선언되어 있으면, 요청 **본문**으로 해석될 것입니다.
-!!! 참고
+!!! note "참고"
FastAPI는 `q`의 값이 필요없음을 알게 될 것입니다. 기본 값이 `= None`이기 때문입니다.
`Union[str, None]`에 있는 `Union`은 FastAPI에 의해 사용된 것이 아니지만, 편집기로 하여금 더 나은 지원과 에러 탐지를 지원할 것입니다.
## Pydantic없이
-만약 Pydantic 모델을 사용하고 싶지 않다면, **Body** 매개변수를 사용할 수도 있습니다. [Body - 다중 매개변수: 본문에 있는 유일한 값](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank} 문서를 확인하세요.
+만약 Pydantic 모델을 사용하고 싶지 않다면, **Body** 매개변수를 사용할 수도 있습니다. [Body - 다중 매개변수: 본문에 있는 유일한 값](body-multiple-params.md#_2){.internal-link target=_blank} 문서를 확인하세요.
diff --git a/docs/ko/docs/tutorial/dependencies/index.md b/docs/ko/docs/tutorial/dependencies/index.md
index c56dddae3..d06864ab8 100644
--- a/docs/ko/docs/tutorial/dependencies/index.md
+++ b/docs/ko/docs/tutorial/dependencies/index.md
@@ -85,12 +85,12 @@
그 후 위의 값을 포함한 `dict` 자료형으로 반환할 뿐입니다.
-!!! 정보
+!!! info "정보"
FastAPI는 0.95.0 버전부터 `Annotated`에 대한 지원을 (그리고 이를 사용하기 권장합니다) 추가했습니다.
옛날 버전을 가지고 있는 경우, `Annotated`를 사용하려 하면 에러를 맞이하게 될 것입니다.
- `Annotated`를 사용하기 전에 최소 0.95.1로 [FastAPI 버전 업그레이드](../../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank}를 확실하게 하세요.
+ `Annotated`를 사용하기 전에 최소 0.95.1로 [FastAPI 버전 업그레이드](../../deployment/versions.md#fastapi_2){.internal-link target=_blank}를 확실하게 하세요.
### `Depends` 불러오기
diff --git a/docs/ko/docs/tutorial/first-steps.md b/docs/ko/docs/tutorial/first-steps.md
index e3b42bce7..bdec3a377 100644
--- a/docs/ko/docs/tutorial/first-steps.md
+++ b/docs/ko/docs/tutorial/first-steps.md
@@ -310,7 +310,7 @@ URL "`/`"에 대한 `GET` 작동을 사용하는 요청을 받을 때마다 **Fa
```
!!! note "참고"
- 차이점을 모르겠다면 [Async: *"In a hurry?"*](../async.md#in-a-hurry){.internal-link target=_blank}을 확인하세요.
+ 차이점을 모르겠다면 [Async: *"바쁘신 경우"*](../async.md#_1){.internal-link target=_blank}을 확인하세요.
### 5 단계: 콘텐츠 반환
diff --git a/docs/ko/docs/tutorial/query-params.md b/docs/ko/docs/tutorial/query-params.md
index 8c7f9167b..43a6c1a36 100644
--- a/docs/ko/docs/tutorial/query-params.md
+++ b/docs/ko/docs/tutorial/query-params.md
@@ -195,4 +195,4 @@ http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
* `limit`, 선택적인 `int`.
!!! tip "팁"
- [경로 매개변수](path-params.md#predefined-values){.internal-link target=_blank}와 마찬가지로 `Enum`을 사용할 수 있습니다.
+ [경로 매개변수](path-params.md#_8){.internal-link target=_blank}와 마찬가지로 `Enum`을 사용할 수 있습니다.
diff --git a/docs/ko/docs/tutorial/security/get-current-user.md b/docs/ko/docs/tutorial/security/get-current-user.md
index 5bc2cee7a..f4b6f9471 100644
--- a/docs/ko/docs/tutorial/security/get-current-user.md
+++ b/docs/ko/docs/tutorial/security/get-current-user.md
@@ -86,12 +86,12 @@ Pydantic 모델인 `User`로 `current_user`의 타입을 선언하는 것을 알
이것은 모든 완료 및 타입 검사를 통해 함수 내부에서 우리를 도울 것입니다.
-!!! 팁
+!!! tip "팁"
요청 본문도 Pydantic 모델로 선언된다는 것을 기억할 것입니다.
여기서 **FastAPI**는 `Depends`를 사용하고 있기 때문에 혼동되지 않습니다.
-!!! 확인
+!!! check "확인"
이 의존성 시스템이 설계된 방식은 모두 `User` 모델을 반환하는 다양한 의존성(다른 "의존적인")을 가질 수 있도록 합니다.
해당 타입의 데이터를 반환할 수 있는 의존성이 하나만 있는 것으로 제한되지 않습니다.
diff --git a/docs/pl/docs/features.md b/docs/pl/docs/features.md
index a6435977c..7c2013799 100644
--- a/docs/pl/docs/features.md
+++ b/docs/pl/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Cechy
## Cechy FastAPI
diff --git a/docs/pl/docs/help-fastapi.md b/docs/pl/docs/help-fastapi.md
index 54c172664..fdc3b0bf9 100644
--- a/docs/pl/docs/help-fastapi.md
+++ b/docs/pl/docs/help-fastapi.md
@@ -78,7 +78,7 @@ Możesz spróbować pomóc innym, odpowiadając w:
W wielu przypadkach możesz już znać odpowiedź na te pytania. 🤓
-Jeśli pomożesz wielu ludziom, możesz zostać oficjalnym [Ekspertem FastAPI](fastapi-people.md#experts){.internal-link target=_blank}. 🎉
+Jeśli pomożesz wielu ludziom, możesz zostać oficjalnym [Ekspertem FastAPI](fastapi-people.md#fastapi-experts){.internal-link target=_blank}. 🎉
Pamiętaj tylko o najważniejszym: bądź życzliwy. Ludzie przychodzą sfrustrowani i w wielu przypadkach nie zadają pytań w najlepszy sposób, ale mimo to postaraj się być dla nich jak najbardziej życzliwy. 🤗
@@ -215,8 +215,8 @@ Jest wiele pracy do zrobienia, a w większości przypadków **TY** możesz to zr
Główne zadania, które możesz wykonać teraz to:
-* [Pomóc innym z pytaniami na GitHubie](#help-others-with-questions-in-github){.internal-link target=_blank} (zobacz sekcję powyżej).
-* [Oceniać Pull Requesty](#review-pull-requests){.internal-link target=_blank} (zobacz sekcję powyżej).
+* [Pomóc innym z pytaniami na GitHubie](#pomagaj-innym-odpowiadajac-na-ich-pytania-na-githubie){.internal-link target=_blank} (zobacz sekcję powyżej).
+* [Oceniać Pull Requesty](#przegladaj-pull-requesty){.internal-link target=_blank} (zobacz sekcję powyżej).
Te dwie czynności **zajmują najwięcej czasu**. To główna praca związana z utrzymaniem FastAPI.
@@ -226,8 +226,8 @@ Jeśli możesz mi w tym pomóc, **pomożesz mi utrzymać FastAPI** i zapewnisz
Dołącz do 👥
serwera czatu na Discordzie 👥 i spędzaj czas z innymi w społeczności FastAPI.
-!!! wskazówka
- Jeśli masz pytania, zadaj je w
Dyskusjach na GitHubie, jest dużo większa szansa, że otrzymasz pomoc od [Ekspertów FastAPI](fastapi-people.md#experts){.internal-link target=_blank}.
+!!! tip "Wskazówka"
+ Jeśli masz pytania, zadaj je w
Dyskusjach na GitHubie, jest dużo większa szansa, że otrzymasz pomoc od [Ekspertów FastAPI](fastapi-people.md#fastapi-experts){.internal-link target=_blank}.
Używaj czatu tylko do innych ogólnych rozmów.
@@ -237,7 +237,7 @@ Miej na uwadze, że ponieważ czaty pozwalają na bardziej "swobodną rozmowę",
Na GitHubie szablon poprowadzi Cię do napisania odpowiedniego pytania, dzięki czemu łatwiej uzyskasz dobrą odpowiedź, a nawet rozwiążesz problem samodzielnie, zanim zapytasz. Ponadto na GitHubie mogę się upewnić, że zawsze odpowiadam na wszystko, nawet jeśli zajmuje to trochę czasu. Osobiście nie mogę tego zrobić z systemami czatu. 😅
-Rozmów w systemach czatu nie można tak łatwo przeszukiwać, jak na GitHubie, więc pytania i odpowiedzi mogą zaginąć w rozmowie. A tylko te na GitHubie liczą się do zostania [Ekspertem FastAPI](fastapi-people.md#experts){.internal-link target=_blank}, więc najprawdopodobniej otrzymasz więcej uwagi na GitHubie.
+Rozmów w systemach czatu nie można tak łatwo przeszukiwać, jak na GitHubie, więc pytania i odpowiedzi mogą zaginąć w rozmowie. A tylko te na GitHubie liczą się do zostania [Ekspertem FastAPI](fastapi-people.md#fastapi-experts){.internal-link target=_blank}, więc najprawdopodobniej otrzymasz więcej uwagi na GitHubie.
Z drugiej strony w systemach czatu są tysiące użytkowników, więc jest duża szansa, że znajdziesz tam kogoś do rozmowy, prawie w każdej chwili. 😄
diff --git a/docs/pl/docs/index.md b/docs/pl/docs/index.md
index ab33bfb9c..06fa706bc 100644
--- a/docs/pl/docs/index.md
+++ b/docs/pl/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -446,12 +455,12 @@ Używane przez Starlette:
*
itsdangerous
- Wymagany dla wsparcia `SessionMiddleware`.
*
pyyaml
- Wymagane dla wsparcia `SchemaGenerator` z Starlette (z FastAPI prawdopodobnie tego nie potrzebujesz).
*
graphene
- Wymagane dla wsparcia `GraphQLApp`.
-*
ujson
- Wymagane jeżeli chcesz korzystać z `UJSONResponse`.
Używane przez FastAPI / Starlette:
*
uvicorn
- jako serwer, który ładuje i obsługuje Twoją aplikację.
*
orjson
- Wymagane jeżeli chcesz używać `ORJSONResponse`.
+*
ujson
- Wymagane jeżeli chcesz korzystać z `UJSONResponse`.
Możesz zainstalować wszystkie te aplikacje przy pomocy `pip install fastapi[all]`.
diff --git a/docs/pl/docs/tutorial/first-steps.md b/docs/pl/docs/tutorial/first-steps.md
index 9406d703d..ce71f8b83 100644
--- a/docs/pl/docs/tutorial/first-steps.md
+++ b/docs/pl/docs/tutorial/first-steps.md
@@ -311,7 +311,7 @@ Możesz również zdefiniować to jako normalną funkcję zamiast `async def`:
```
!!! note
- Jeśli nie znasz różnicy, sprawdź [Async: *"In a hurry?"*](/async/#in-a-hurry){.internal-link target=_blank}.
+ Jeśli nie znasz różnicy, sprawdź [Async: *"In a hurry?"*](../async.md#in-a-hurry){.internal-link target=_blank}.
### Krok 5: zwróć zawartość
diff --git a/docs/pt/docs/advanced/events.md b/docs/pt/docs/advanced/events.md
index 7f6cb6f5d..12aa93f29 100644
--- a/docs/pt/docs/advanced/events.md
+++ b/docs/pt/docs/advanced/events.md
@@ -160,4 +160,4 @@ Por baixo, na especificação técnica ASGI, essa é a parte do
@@ -109,7 +109,7 @@ Isso pode depender principalmente da ferramenta que você usa para **instalar**
O caminho mais comum de fazer isso é ter um arquivo `requirements.txt` com os nomes dos pacotes e suas versões, um por linha.
-Você, naturalmente, usaria as mesmas ideias que você leu em [Sobre Versões do FastAPI](./versions.md){.internal-link target=_blank} para definir os intervalos de versões.
+Você, naturalmente, usaria as mesmas ideias que você leu em [Sobre Versões do FastAPI](versions.md){.internal-link target=_blank} para definir os intervalos de versões.
Por exemplo, seu `requirements.txt` poderia parecer com:
@@ -374,7 +374,7 @@ Então ajuste o comando Uvicorn para usar o novo módulo `main` em vez de `app.m
## Conceitos de Implantação
-Vamos falar novamente sobre alguns dos mesmos [Conceitos de Implantação](./concepts.md){.internal-link target=_blank} em termos de contêineres.
+Vamos falar novamente sobre alguns dos mesmos [Conceitos de Implantação](concepts.md){.internal-link target=_blank} em termos de contêineres.
Contêineres são principalmente uma ferramenta para simplificar o processo de **construção e implantação** de um aplicativo, mas eles não impõem uma abordagem particular para lidar com esses **conceitos de implantação** e existem várias estratégias possíveis.
@@ -515,14 +515,14 @@ Se você tiver uma configuração simples, com um **único contêiner** que ent
## Imagem Oficial do Docker com Gunicorn - Uvicorn
-Há uma imagem oficial do Docker que inclui o Gunicorn executando com trabalhadores Uvicorn, conforme detalhado em um capítulo anterior: [Server Workers - Gunicorn com Uvicorn](./server-workers.md){.internal-link target=_blank}.
+Há uma imagem oficial do Docker que inclui o Gunicorn executando com trabalhadores Uvicorn, conforme detalhado em um capítulo anterior: [Server Workers - Gunicorn com Uvicorn](server-workers.md){.internal-link target=_blank}.
-Essa imagem seria útil principalmente nas situações descritas acima em: [Contêineres com Múltiplos Processos e Casos Especiais](#contêineres-com-múltiplos-processos-e-casos-Especiais).
+Essa imagem seria útil principalmente nas situações descritas acima em: [Contêineres com Múltiplos Processos e Casos Especiais](#conteineres-com-multiplos-processos-e-casos-especiais).
* tiangolo/uvicorn-gunicorn-fastapi.
!!! warning
- Existe uma grande chance de que você **não** precise dessa imagem base ou de qualquer outra semelhante, e seria melhor construir a imagem do zero, como [descrito acima em: Construa uma Imagem Docker para o FastAPI](#construa-uma-imagem-docker-para-o-fastapi).
+ Existe uma grande chance de que você **não** precise dessa imagem base ou de qualquer outra semelhante, e seria melhor construir a imagem do zero, como [descrito acima em: Construa uma Imagem Docker para o FastAPI](#construindo-uma-imagem-docker-para-fastapi).
Essa imagem tem um mecanismo de **auto-ajuste** incluído para definir o **número de processos trabalhadores** com base nos núcleos de CPU disponíveis.
@@ -579,7 +579,7 @@ COPY ./app /app/app
Você provavelmente **não** deve usar essa imagem base oficial (ou qualquer outra semelhante) se estiver usando **Kubernetes** (ou outros) e já estiver definindo **replicação** no nível do cluster, com vários **contêineres**. Nesses casos, é melhor **construir uma imagem do zero** conforme descrito acima: [Construindo uma Imagem Docker para FastAPI](#construindo-uma-imagem-docker-para-fastapi).
-Essa imagem seria útil principalmente nos casos especiais descritos acima em [Contêineres com Múltiplos Processos e Casos Especiais](#contêineres-com-múltiplos-processos-e-casos-Especiais). Por exemplo, se sua aplicação for **simples o suficiente** para que a configuração padrão de número de processos com base na CPU funcione bem, você não quer se preocupar com a configuração manual da replicação no nível do cluster e não está executando mais de um contêiner com seu aplicativo. Ou se você estiver implantando com **Docker Compose**, executando em um único servidor, etc.
+Essa imagem seria útil principalmente nos casos especiais descritos acima em [Contêineres com Múltiplos Processos e Casos Especiais](#conteineres-com-multiplos-processos-e-casos-especiais). Por exemplo, se sua aplicação for **simples o suficiente** para que a configuração padrão de número de processos com base na CPU funcione bem, você não quer se preocupar com a configuração manual da replicação no nível do cluster e não está executando mais de um contêiner com seu aplicativo. Ou se você estiver implantando com **Docker Compose**, executando em um único servidor, etc.
## Deploy da Imagem do Contêiner
diff --git a/docs/pt/docs/fastapi-people.md b/docs/pt/docs/fastapi-people.md
index 20061bfd9..93c3479f2 100644
--- a/docs/pt/docs/fastapi-people.md
+++ b/docs/pt/docs/fastapi-people.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Pessoas do FastAPI
FastAPI possue uma comunidade incrível que recebe pessoas de todos os níveis.
@@ -18,7 +23,7 @@ Este sou eu:
{% endif %}
-Eu sou o criador e mantenedor do **FastAPI**. Você pode ler mais sobre isso em [Help FastAPI - Get Help - Connect with the author](help-fastapi.md#connect-with-the-author){.internal-link target=_blank}.
+Eu sou o criador e mantenedor do **FastAPI**. Você pode ler mais sobre isso em [Help FastAPI - Get Help - Connect with the author](help-fastapi.md#conect-se-com-o-autor){.internal-link target=_blank}.
...Mas aqui eu quero mostrar a você a comunidade.
@@ -28,15 +33,15 @@ Eu sou o criador e mantenedor do **FastAPI**. Você pode ler mais sobre isso em
Estas são as pessoas que:
-* [Help others with issues (questions) in GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}.
-* [Create Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
-* Revisar Pull Requests, [especially important for translations](contributing.md#translations){.internal-link target=_blank}.
+* [Help others with issues (questions) in GitHub](help-fastapi.md#responda-perguntas-no-github){.internal-link target=_blank}.
+* [Create Pull Requests](help-fastapi.md#crie-um-pull-request){.internal-link target=_blank}.
+* Revisar Pull Requests, [especially important for translations](contributing.md#traducoes){.internal-link target=_blank}.
Uma salva de palmas para eles. 👏 🙇
## Usuários mais ativos do ultimo mês
-Estes são os usuários que estão [helping others the most with issues (questions) in GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} durante o ultimo mês. ☕
+Estes são os usuários que estão [helping others the most with issues (questions) in GitHub](help-fastapi.md#responda-perguntas-no-github){.internal-link target=_blank} durante o ultimo mês. ☕
{% if people %}
@@ -53,7 +58,7 @@ Estes são os usuários que estão [helping others the most with issues (questio
Aqui está os **Especialistas do FastAPI**. 🤓
-Estes são os usuários que [helped others the most with issues (questions) in GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} em *todo o tempo*.
+Estes são os usuários que [helped others the most with issues (questions) in GitHub](help-fastapi.md#responda-perguntas-no-github){.internal-link target=_blank} em *todo o tempo*.
Eles provaram ser especialistas ajudando muitos outros. ✨
@@ -71,7 +76,7 @@ Eles provaram ser especialistas ajudando muitos outros. ✨
Aqui está os **Top Contribuidores**. 👷
-Esses usuários têm [created the most Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank} que tem sido *mergeado*.
+Esses usuários têm [created the most Pull Requests](help-fastapi.md#crie-um-pull-request){.internal-link target=_blank} que tem sido *mergeado*.
Eles contribuíram com o código-fonte, documentação, traduções, etc. 📦
@@ -93,7 +98,7 @@ Esses usuários são os **Top Revisores**. 🕵️
### Revisões para Traduções
-Eu só falo algumas línguas (e não muito bem 😅). Então, os revisores são aqueles que têm o [**poder de aprovar traduções**](contributing.md#translations){.internal-link target=_blank} da documentação. Sem eles, não haveria documentação em vários outros idiomas.
+Eu só falo algumas línguas (e não muito bem 😅). Então, os revisores são aqueles que têm o [**poder de aprovar traduções**](contributing.md#traducoes){.internal-link target=_blank} da documentação. Sem eles, não haveria documentação em vários outros idiomas.
---
diff --git a/docs/pt/docs/features.md b/docs/pt/docs/features.md
index 64efeeae1..c514fc8e3 100644
--- a/docs/pt/docs/features.md
+++ b/docs/pt/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Recursos
## Recursos do FastAPI
diff --git a/docs/pt/docs/help-fastapi.md b/docs/pt/docs/help-fastapi.md
index 06a4db1e0..babb404f9 100644
--- a/docs/pt/docs/help-fastapi.md
+++ b/docs/pt/docs/help-fastapi.md
@@ -72,7 +72,7 @@ Adoro ouvir sobre como o **FastAPI** é usado, o que você gosta nele, em qual p
Você pode acompanhar as
perguntas existentes e tentar ajudar outros, . 🤓
-Ajudando a responder as questões de varias pessoas, você pode se tornar um [Expert em FastAPI](fastapi-people.md#experts){.internal-link target=_blank} oficial. 🎉
+Ajudando a responder as questões de varias pessoas, você pode se tornar um [Expert em FastAPI](fastapi-people.md#especialistas){.internal-link target=_blank} oficial. 🎉
## Acompanhe o repositório do GitHub
@@ -98,7 +98,7 @@ Assim podendo tentar ajudar a resolver essas questões.
* Para corrigir um erro de digitação que você encontrou na documentação.
* Para compartilhar um artigo, video, ou podcast criados por você sobre o FastAPI
editando este arquivo.
* Não se esqueça de adicionar o link no começo da seção correspondente.
-* Para ajudar [traduzir a documentação](contributing.md#translations){.internal-link target=_blank} para sua lingua.
+* Para ajudar [traduzir a documentação](contributing.md#traducoes){.internal-link target=_blank} para sua lingua.
* Também é possivel revisar as traduções já existentes.
* Para propor novas seções na documentação.
* Para corrigir um bug/questão.
@@ -109,8 +109,8 @@ Assim podendo tentar ajudar a resolver essas questões.
Entre no 👥
server de conversa do Discord 👥 e conheça novas pessoas da comunidade
do FastAPI.
-!!! dica
- Para perguntas, pergunte nas
questões do GitHub, lá tem um chance maior de você ser ajudado sobre o FastAPI [FastAPI Experts](fastapi-people.md#experts){.internal-link target=_blank}.
+!!! tip "Dica"
+ Para perguntas, pergunte nas
questões do GitHub, lá tem um chance maior de você ser ajudado sobre o FastAPI [FastAPI Experts](fastapi-people.md#especialistas){.internal-link target=_blank}.
Use o chat apenas para outro tipo de assunto.
@@ -120,7 +120,7 @@ Tenha em mente que os chats permitem uma "conversa mais livre", dessa forma é m
Nas questões do GitHub o template irá te guiar para que você faça a sua pergunta de um jeito mais correto, fazendo com que você receba respostas mais completas, e até mesmo que você mesmo resolva o problema antes de perguntar. E no GitHub eu garanto que sempre irei responder todas as perguntas, mesmo que leve um tempo. Eu pessoalmente não consigo fazer isso via chat. 😅
-Conversas no chat não são tão fáceis de serem encontrados quanto no GitHub, então questões e respostas podem se perder dentro da conversa. E apenas as que estão nas questões do GitHub contam para você se tornar um [Expert em FastAPI](fastapi-people.md#experts){.internal-link target=_blank}, então você receberá mais atenção nas questões do GitHub.
+Conversas no chat não são tão fáceis de serem encontrados quanto no GitHub, então questões e respostas podem se perder dentro da conversa. E apenas as que estão nas questões do GitHub contam para você se tornar um [Expert em FastAPI](fastapi-people.md#especialistas){.internal-link target=_blank}, então você receberá mais atenção nas questões do GitHub.
Por outro lado, existem milhares de usuários no chat, então tem uma grande chance de você encontrar alguém para trocar uma idéia por lá em qualquer horário. 😄
diff --git a/docs/pt/docs/index.md b/docs/pt/docs/index.md
index 05786a0aa..86b77f117 100644
--- a/docs/pt/docs/index.md
+++ b/docs/pt/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -440,12 +449,12 @@ Usados por Starlette:
*
itsdangerous
- Necessário para suporte a `SessionMiddleware`.
*
pyyaml
- Necessário para suporte a `SchemaGenerator` da Starlette (você provavelmente não precisará disso com o FastAPI).
*
graphene
- Necessário para suporte a `GraphQLApp`.
-*
ujson
- Necessário se você quer utilizar `UJSONResponse`.
Usados por FastAPI / Starlette:
*
uvicorn
- para o servidor que carrega e serve sua aplicação.
*
orjson
- Necessário se você quer utilizar `ORJSONResponse`.
+*
ujson
- Necessário se você quer utilizar `UJSONResponse`.
Você pode instalar todas essas dependências com `pip install fastapi[all]`.
diff --git a/docs/pt/docs/tutorial/body-multiple-params.md b/docs/pt/docs/tutorial/body-multiple-params.md
index 0eaa9664c..7d0435a6b 100644
--- a/docs/pt/docs/tutorial/body-multiple-params.md
+++ b/docs/pt/docs/tutorial/body-multiple-params.md
@@ -20,7 +20,7 @@ E você também pode declarar parâmetros de corpo como opcionais, definindo o v
{!> ../../../docs_src/body_multiple_params/tutorial001.py!}
```
-!!! nota
+!!! note "Nota"
Repare que, neste caso, o `item` que seria capturado a partir do corpo é opcional. Visto que ele possui `None` como valor padrão.
## Múltiplos parâmetros de corpo
@@ -69,7 +69,7 @@ Então, ele usará o nome dos parâmetros como chaves (nome dos campos) no corpo
}
```
-!!! nota
+!!! note "Nota"
Repare que mesmo que o `item` esteja declarado da mesma maneira que antes, agora é esperado que ele esteja dentro do corpo com uma chave `item`.
diff --git a/docs/pt/docs/tutorial/body-nested-models.md b/docs/pt/docs/tutorial/body-nested-models.md
index e039b09b2..c9d0b8bb6 100644
--- a/docs/pt/docs/tutorial/body-nested-models.md
+++ b/docs/pt/docs/tutorial/body-nested-models.md
@@ -165,7 +165,7 @@ Isso vai esperar(converter, validar, documentar, etc) um corpo JSON tal qual:
}
```
-!!! Informação
+!!! info "informação"
Note como o campo `images` agora tem uma lista de objetos de image.
## Modelos profundamente aninhados
@@ -176,7 +176,7 @@ Você pode definir modelos profundamente aninhados de forma arbitrária:
{!../../../docs_src/body_nested_models/tutorial007.py!}
```
-!!! Informação
+!!! info "informação"
Note como `Offer` tem uma lista de `Item`s, que por sua vez possui opcionalmente uma lista `Image`s
## Corpos de listas puras
@@ -226,7 +226,7 @@ Neste caso, você aceitaria qualquer `dict`, desde que tenha chaves` int` com va
{!../../../docs_src/body_nested_models/tutorial009.py!}
```
-!!! Dica
+!!! tip "Dica"
Leve em condideração que o JSON só suporta `str` como chaves.
Mas o Pydantic tem conversão automática de dados.
diff --git a/docs/pt/docs/tutorial/body.md b/docs/pt/docs/tutorial/body.md
index 5901b8414..713bea2d1 100644
--- a/docs/pt/docs/tutorial/body.md
+++ b/docs/pt/docs/tutorial/body.md
@@ -162,4 +162,4 @@ Os parâmetros da função serão reconhecidos conforme abaixo:
## Sem o Pydantic
-Se você não quer utilizar os modelos Pydantic, você também pode utilizar o parâmetro **Body**. Veja a documentação para [Body - Parâmetros múltiplos: Valores singulares no body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
+Se você não quer utilizar os modelos Pydantic, você também pode utilizar o parâmetro **Body**. Veja a documentação para [Body - Parâmetros múltiplos: Valores singulares no body](body-multiple-params.md#valores-singulares-no-corpo){.internal-link target=_blank}.
diff --git a/docs/pt/docs/tutorial/encoder.md b/docs/pt/docs/tutorial/encoder.md
index b9bfbf63b..7a8d20515 100644
--- a/docs/pt/docs/tutorial/encoder.md
+++ b/docs/pt/docs/tutorial/encoder.md
@@ -38,5 +38,5 @@ O resultado de chamar a função é algo que pode ser codificado com o padrão d
A função não retorna um grande `str` contendo os dados no formato JSON (como uma string). Mas sim, retorna uma estrutura de dados padrão do Python (por exemplo, um `dict`) com valores e subvalores compatíveis com JSON.
-!!! nota
+!!! note "Nota"
`jsonable_encoder` é realmente usado pelo **FastAPI** internamente para converter dados. Mas também é útil em muitos outros cenários.
diff --git a/docs/pt/docs/tutorial/first-steps.md b/docs/pt/docs/tutorial/first-steps.md
index 9fcdaf91f..619a68601 100644
--- a/docs/pt/docs/tutorial/first-steps.md
+++ b/docs/pt/docs/tutorial/first-steps.md
@@ -24,7 +24,7 @@ $ uvicorn main:app --reload
-!!! nota
+!!! note "Nota"
O comando `uvicorn main:app` se refere a:
* `main`: o arquivo `main.py` (o "módulo" Python).
@@ -136,7 +136,7 @@ Você também pode usá-lo para gerar código automaticamente para clientes que
`FastAPI` é uma classe Python que fornece todas as funcionalidades para sua API.
-!!! nota "Detalhes técnicos"
+!!! note "Detalhes técnicos"
`FastAPI` é uma classe que herda diretamente de `Starlette`.
Você pode usar todas as funcionalidades do
Starlette com `FastAPI` também.
@@ -309,7 +309,7 @@ Você também pode defini-la como uma função normal em vez de `async def`:
{!../../../docs_src/first_steps/tutorial003.py!}
```
-!!! nota
+!!! note "Nota"
Se você não sabe a diferença, verifique o [Async: *"Com pressa?"*](../async.md#com-pressa){.internal-link target=_blank}.
### Passo 5: retorne o conteúdo
diff --git a/docs/pt/docs/tutorial/index.md b/docs/pt/docs/tutorial/index.md
index 5fc0485a0..60fc26ae0 100644
--- a/docs/pt/docs/tutorial/index.md
+++ b/docs/pt/docs/tutorial/index.md
@@ -52,7 +52,7 @@ $ pip install "fastapi[all]"
...isso também inclui o `uvicorn`, que você pode usar como o servidor que rodará seu código.
-!!! nota
+!!! note "Nota"
Você também pode instalar parte por parte.
Isso é provavelmente o que você faria quando você quisesse lançar sua aplicação em produção:
diff --git a/docs/pt/docs/tutorial/path-params.md b/docs/pt/docs/tutorial/path-params.md
index be2b7f7a4..27aa9dfcf 100644
--- a/docs/pt/docs/tutorial/path-params.md
+++ b/docs/pt/docs/tutorial/path-params.md
@@ -24,7 +24,7 @@ Você pode declarar o tipo de um parâmetro na função usando as anotações pa
Nesse caso, `item_id` está sendo declarado como um `int`.
-!!! Check Verifique
+!!! check "Verifique"
Isso vai dar à você suporte do seu editor dentro das funções, com verificações de erros, autocompletar, etc.
## Conversão de
dados
@@ -35,7 +35,7 @@ Se você rodar esse exemplo e abrir o seu navegador em
"parsing" automático no request .
@@ -63,7 +63,7 @@ devido ao parâmetro da rota `item_id` ter um valor `"foo"`, que não é um `int
O mesmo erro apareceria se você tivesse fornecido um `float` ao invés de um `int`, como em: http://127.0.0.1:8000/items/4.2
-!!! Verifique
+!!! check "Verifique"
Então, com a mesma declaração de tipo do Python, o **FastAPI** dá pra você validação de dados.
Observe que o erro também mostra claramente o ponto exato onde a validação não passou.
@@ -76,7 +76,7 @@ Quando você abrir o seu navegador em
-!!! check
+!!! check "Verifique"
Novamente, apenas com a mesma declaração de tipo do Python, o **FastAPI** te dá de forma automática e interativa a documentação (integrada com o Swagger UI).
Veja que o parâmetro de rota está declarado como sendo um inteiro (int).
@@ -131,10 +131,10 @@ Assim, crie atributos de classe com valores fixos, que serão os valores válido
{!../../../docs_src/path_params/tutorial005.py!}
```
-!!! informação
+!!! info "informação"
Enumerations (ou enums) estão disponíveis no Python desde a versão 3.4.
-!!! dica
+!!! tip "Dica"
Se você está se perguntando, "AlexNet", "ResNet", e "LeNet" são apenas nomes de
modelos de Machine Learning (aprendizado de máquina).
### Declare um *parâmetro de rota*
@@ -171,7 +171,7 @@ Você pode ter o valor exato de enumerate (um `str` nesse caso) usando `model_na
{!../../../docs_src/path_params/tutorial005.py!}
```
-!!! conselho
+!!! tip "Dica"
Você também poderia acessar o valor `"lenet"` com `ModelName.lenet.value`
#### Retorne *membros de enumeration*
@@ -225,7 +225,7 @@ Então, você poderia usar ele com:
{!../../../docs_src/path_params/tutorial004.py!}
```
-!!! dica
+!!! tip "Dica"
Você poderia precisar que o parâmetro contivesse `/home/johndoe/myfile.txt`, com uma barra no inicio (`/`).
Neste caso, a URL deveria ser: `/files//home/johndoe/myfile.txt`, com barra dupla (`//`) entre `files` e `home`.
diff --git a/docs/pt/docs/tutorial/query-params.md b/docs/pt/docs/tutorial/query-params.md
index 08bb99dbc..ff6f38fe5 100644
--- a/docs/pt/docs/tutorial/query-params.md
+++ b/docs/pt/docs/tutorial/query-params.md
@@ -222,4 +222,4 @@ Nesse caso, existem 3 parâmetros de consulta:
* `limit`, um `int` opcional.
!!! tip "Dica"
- Você também poderia usar `Enum` da mesma forma que com [Path Parameters](path-params.md#predefined-values){.internal-link target=_blank}.
+ Você também poderia usar `Enum` da mesma forma que com [Path Parameters](path-params.md#valores-predefinidos){.internal-link target=_blank}.
diff --git a/docs/pt/docs/tutorial/security/first-steps.md b/docs/pt/docs/tutorial/security/first-steps.md
index 395621d3b..4331a0bc3 100644
--- a/docs/pt/docs/tutorial/security/first-steps.md
+++ b/docs/pt/docs/tutorial/security/first-steps.md
@@ -25,7 +25,7 @@ Copie o exemplo em um arquivo `main.py`:
## Execute-o
-!!! informação
+!!! info "informação"
Primeiro, instale
`python-multipart`.
Ex: `pip install python-multipart`.
@@ -52,7 +52,7 @@ Você verá algo deste tipo:

-!!! marque o "botão de Autorizar!"
+!!! check "Botão de Autorizar!"
Você já tem um novo "botão de autorizar!".
E seu *path operation* tem um pequeno cadeado no canto superior direito que você pode clicar.
@@ -61,7 +61,7 @@ E se você clicar, você terá um pequeno formulário de autorização para digi

-!!! nota
+!!! note "Nota"
Não importa o que você digita no formulário, não vai funcionar ainda. Mas nós vamos chegar lá.
Claro que este não é o frontend para os usuários finais, mas é uma ótima ferramenta automática para documentar interativamente toda sua API.
@@ -104,7 +104,7 @@ Então, vamos rever de um ponto de vista simplificado:
Neste exemplo, nós vamos usar o **OAuth2** com o fluxo de **Senha**, usando um token **Bearer**. Fazemos isso usando a classe `OAuth2PasswordBearer`.
-!!! informação
+!!! info "informação"
Um token "bearer" não é a única opção.
Mas é a melhor no nosso caso.
@@ -119,7 +119,7 @@ Quando nós criamos uma instância da classe `OAuth2PasswordBearer`, nós passam
{!../../../docs_src/security/tutorial001.py!}
```
-!!! dica
+!!! tip "Dica"
Esse `tokenUrl="token"` se refere a uma URL relativa que nós não criamos ainda. Como é uma URL relativa, é equivalente a `./token`.
Porque estamos usando uma URL relativa, se sua API estava localizada em `https://example.com/`, então irá referir-se à `https://example.com/token`. Mas se sua API estava localizada em `https://example.com/api/v1/`, então irá referir-se à `https://example.com/api/v1/token`.
@@ -130,7 +130,7 @@ Esse parâmetro não cria um endpoint / *path operation*, mas declara que a URL
Em breve também criaremos o atual path operation.
-!!! informação
+!!! info "informação"
Se você é um "Pythonista" muito rigoroso, você pode não gostar do estilo do nome do parâmetro `tokenUrl` em vez de `token_url`.
Isso ocorre porque está utilizando o mesmo nome que está nas especificações do OpenAPI. Então, se você precisa investigar mais sobre qualquer um desses esquemas de segurança, você pode simplesmente copiar e colar para encontrar mais informações sobre isso.
@@ -157,7 +157,7 @@ Esse dependência vai fornecer uma `str` que é atribuído ao parâmetro `token
A **FastAPI** saberá que pode usar essa dependência para definir um "esquema de segurança" no esquema da OpenAPI (e na documentação da API automática).
-!!! informação "Detalhes técnicos"
+!!! info "Detalhes técnicos"
**FastAPI** saberá que pode usar a classe `OAuth2PasswordBearer` (declarada na dependência) para definir o esquema de segurança na OpenAPI porque herda de `fastapi.security.oauth2.OAuth2`, que por sua vez herda de `fastapi.security.base.Securitybase`.
Todos os utilitários de segurança que se integram com OpenAPI (e na documentação da API automática) herdam de `SecurityBase`, é assim que **FastAPI** pode saber como integrá-los no OpenAPI.
diff --git a/docs/ru/docs/async.md b/docs/ru/docs/async.md
index 4d3ce2adf..20dbb108b 100644
--- a/docs/ru/docs/async.md
+++ b/docs/ru/docs/async.md
@@ -468,7 +468,7 @@ Starlette (и **FastAPI**) основаны на
Ещё раз повторим, что все эти технические подробности полезны, только если вы специально их искали.
-В противном случае просто ознакомьтесь с основными принципами в разделе выше: Нет времени?.
+В противном случае просто ознакомьтесь с основными принципами в разделе выше:
Нет времени?.
diff --git a/docs/ru/docs/deployment/concepts.md b/docs/ru/docs/deployment/concepts.md
index 771f4bf68..26db356c1 100644
--- a/docs/ru/docs/deployment/concepts.md
+++ b/docs/ru/docs/deployment/concepts.md
@@ -25,7 +25,7 @@
## Использование более безопасного протокола HTTPS
-В [предыдущей главе об HTTPS](./https.md){.internal-link target=_blank} мы рассмотрели, как HTTPS обеспечивает шифрование для вашего API.
+В [предыдущей главе об HTTPS](https.md){.internal-link target=_blank} мы рассмотрели, как HTTPS обеспечивает шифрование для вашего API.
Также мы заметили, что обычно для работы с HTTPS вашему приложению нужен **дополнительный** компонент - **прокси-сервер завершения работы TLS**.
@@ -187,7 +187,7 @@
### Процессы и порты́
-Помните ли Вы, как на странице [Об HTTPS](./https.md){.internal-link target=_blank} мы обсуждали, что на сервере только один процесс может слушать одну комбинацию IP-адреса и порта?
+Помните ли Вы, как на странице [Об HTTPS](https.md){.internal-link target=_blank} мы обсуждали, что на сервере только один процесс может слушать одну комбинацию IP-адреса и порта?
С тех пор ничего не изменилось.
@@ -241,7 +241,7 @@
!!! tip "Заметка"
Если вы не знаете, что такое **контейнеры**, Docker или Kubernetes, не переживайте.
- Я поведаю Вам о контейнерах, образах, Docker, Kubernetes и т.п. в главе: [FastAPI внутри контейнеров - Docker](./docker.md){.internal-link target=_blank}.
+ Я поведаю Вам о контейнерах, образах, Docker, Kubernetes и т.п. в главе: [FastAPI внутри контейнеров - Docker](docker.md){.internal-link target=_blank}.
## Шаги, предшествующие запуску
@@ -273,7 +273,7 @@
* При этом Вам всё ещё нужно найти способ - как запускать/перезапускать *такой* bash-скрипт, обнаруживать ошибки и т.п.
!!! tip "Заметка"
- Я приведу Вам больше конкретных примеров работы с контейнерами в главе: [FastAPI внутри контейнеров - Docker](./docker.md){.internal-link target=_blank}.
+ Я приведу Вам больше конкретных примеров работы с контейнерами в главе: [FastAPI внутри контейнеров - Docker](docker.md){.internal-link target=_blank}.
## Утилизация ресурсов
diff --git a/docs/ru/docs/deployment/docker.md b/docs/ru/docs/deployment/docker.md
index 78d3ec1b4..ce4972c4f 100644
--- a/docs/ru/docs/deployment/docker.md
+++ b/docs/ru/docs/deployment/docker.md
@@ -110,7 +110,7 @@ Docker является одним оз основных инструменто
Чаще всего это простой файл `requirements.txt` с построчным перечислением библиотек и их версий.
-При этом Вы, для выбора версий, будете использовать те же идеи, что упомянуты на странице [О версиях FastAPI](./versions.md){.internal-link target=_blank}.
+При этом Вы, для выбора версий, будете использовать те же идеи, что упомянуты на странице [О версиях FastAPI](versions.md){.internal-link target=_blank}.
Ваш файл `requirements.txt` может выглядеть как-то так:
@@ -374,7 +374,7 @@ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
## Концепции развёртывания
-Давайте вспомним о [Концепциях развёртывания](./concepts.md){.internal-link target=_blank} и применим их к контейнерам.
+Давайте вспомним о [Концепциях развёртывания](concepts.md){.internal-link target=_blank} и применим их к контейнерам.
Контейнеры - это, в основном, инструмент упрощающий **сборку и развёртывание** приложения и они не обязывают к применению какой-то определённой **концепции развёртывания**, а значит мы можем выбирать нужную стратегию.
@@ -447,7 +447,7 @@ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
Использование менеджера процессов (Gunicorn или Uvicorn) внутри контейнера только добавляет **излишнее усложнение**, так как управление следует осуществлять системой оркестрации.
-###
Множество процессов внутри контейнера для особых случаев
+### Множество процессов внутри контейнера для особых случаев
Безусловно, бывают **особые случаи**, когда может понадобиться внутри контейнера запускать **менеджер процессов Gunicorn**, управляющий несколькими **процессами Uvicorn**.
@@ -515,9 +515,9 @@ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
## Официальный Docker-образ с Gunicorn и Uvicorn
-Я подготовил для вас Docker-образ, в который включён Gunicorn управляющий процессами (воркерами) Uvicorn, в соответствии с концепциями рассмотренными в предыдущей главе: [Рабочие процессы сервера (воркеры) - Gunicorn совместно с Uvicorn](./server-workers.md){.internal-link target=_blank}.
+Я подготовил для вас Docker-образ, в который включён Gunicorn управляющий процессами (воркерами) Uvicorn, в соответствии с концепциями рассмотренными в предыдущей главе: [Рабочие процессы сервера (воркеры) - Gunicorn совместно с Uvicorn](server-workers.md){.internal-link target=_blank}.
-Этот образ может быть полезен для ситуаций описанных тут: [Множество процессов внутри контейнера для особых случаев](#special-cases).
+Этот образ может быть полезен для ситуаций описанных тут: [Множество процессов внутри контейнера для особых случаев](#_11).
*
tiangolo/uvicorn-gunicorn-fastapi.
@@ -578,7 +578,7 @@ COPY ./app /app/app
Если вы используете **Kubernetes** (или что-то вроде того), скорее всего вам **не нужно** использовать официальный Docker-образ (или другой похожий) в качестве основы, так как управление **количеством запущенных контейнеров** должно быть настроено на уровне кластера. В таком случае лучше **создать образ с нуля**, как описано в разделе Создать [Docker-образ для FastAPI](#docker-fastapi).
-Официальный образ может быть полезен в отдельных случаях, описанных выше в разделе [Множество процессов внутри контейнера для особых случаев](#special-cases). Например, если ваше приложение **достаточно простое**, не требует запуска в кластере и способно уместиться в один контейнер, то его настройки по умолчанию будут работать довольно хорошо. Или же вы развертываете его с помощью **Docker Compose**, работаете на одном сервере и т. д
+Официальный образ может быть полезен в отдельных случаях, описанных выше в разделе [Множество процессов внутри контейнера для особых случаев](#_11). Например, если ваше приложение **достаточно простое**, не требует запуска в кластере и способно уместиться в один контейнер, то его настройки по умолчанию будут работать довольно хорошо. Или же вы развертываете его с помощью **Docker Compose**, работаете на одном сервере и т. д
## Развёртывание образа контейнера
diff --git a/docs/ru/docs/deployment/versions.md b/docs/ru/docs/deployment/versions.md
index 91b9038e9..f410e3936 100644
--- a/docs/ru/docs/deployment/versions.md
+++ b/docs/ru/docs/deployment/versions.md
@@ -42,7 +42,7 @@ fastapi>=0.45.0,<0.46.0
FastAPI следует соглашению в том, что любые изменения "ПАТЧ"-версии предназначены для исправления багов и внесения обратно совместимых изменений.
-!!! Подсказка
+!!! tip "Подсказка"
"ПАТЧ" - это последнее число. Например, в `0.2.3`, ПАТЧ-версия - это `3`.
Итак, вы можете закрепить версию следующим образом:
@@ -53,7 +53,7 @@ fastapi>=0.45.0,<0.46.0
Обратно несовместимые изменения и новые функции добавляются в "МИНОРНЫЕ" версии.
-!!! Подсказка
+!!! tip "Подсказка"
"МИНОРНАЯ" версия - это число в середине. Например, в `0.2.3` МИНОРНАЯ версия - это `2`.
## Обновление версий FastAPI
diff --git a/docs/ru/docs/fastapi-people.md b/docs/ru/docs/fastapi-people.md
index 0e42aab69..fa70d168e 100644
--- a/docs/ru/docs/fastapi-people.md
+++ b/docs/ru/docs/fastapi-people.md
@@ -1,3 +1,7 @@
+---
+hide:
+ - navigation
+---
# Люди, поддерживающие FastAPI
@@ -19,7 +23,7 @@
{% endif %}
-Я создал и продолжаю поддерживать **FastAPI**. Узнать обо мне больше можно тут [Помочь FastAPI - Получить помощь - Связаться с автором](help-fastapi.md#connect-with-the-author){.internal-link target=_blank}.
+Я создал и продолжаю поддерживать **FastAPI**. Узнать обо мне больше можно тут [Помочь FastAPI - Получить помощь - Связаться с автором](help-fastapi.md#_2){.internal-link target=_blank}.
... но на этой странице я хочу показать вам наше сообщество.
@@ -29,15 +33,15 @@
Это люди, которые:
-* [Помогают другим с их проблемами (вопросами) на GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}.
-* [Создают пул-реквесты](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
-* Делают ревью пул-реквестов, [что особенно важно для переводов на другие языки](contributing.md#translations){.internal-link target=_blank}.
+* [Помогают другим с их проблемами (вопросами) на GitHub](help-fastapi.md#github_1){.internal-link target=_blank}.
+* [Создают пул-реквесты](help-fastapi.md#-_1){.internal-link target=_blank}.
+* Делают ревью пул-реквестов, [что особенно важно для переводов на другие языки](contributing.md#_8){.internal-link target=_blank}.
Поаплодируем им! 👏 🙇
## Самые активные участники за прошедший месяц
-Эти участники [оказали наибольшую помощь другим с решением их проблем (вопросов) на GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} в течение последнего месяца. ☕
+Эти участники [оказали наибольшую помощь другим с решением их проблем (вопросов) на GitHub](help-fastapi.md#github_1){.internal-link target=_blank} в течение последнего месяца. ☕
{% if people %}
@@ -53,7 +57,7 @@
Здесь представлены **Эксперты FastAPI**. 🤓
-Эти участники [оказали наибольшую помощь другим с решением их проблем (вопросов) на GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} за *всё время*.
+Эти участники [оказали наибольшую помощь другим с решением их проблем (вопросов) на GitHub](help-fastapi.md#github_1){.internal-link target=_blank} за *всё время*.
Оказывая помощь многим другим, они подтвердили свой уровень знаний. ✨
@@ -71,7 +75,7 @@
Здесь представлен **Рейтинг участников, внёсших вклад в код**. 👷
-Эти люди [сделали наибольшее количество пул-реквестов](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}, *включённых в основной код*.
+Эти люди [сделали наибольшее количество пул-реквестов](help-fastapi.md#-_1){.internal-link target=_blank}, *включённых в основной код*.
Они сделали наибольший вклад в исходный код, документацию, переводы и т.п. 📦
@@ -94,7 +98,7 @@
### Проверки переводов на другие языки
Я знаю не очень много языков (и не очень хорошо 😅).
-Итак, ревьюеры - это люди, которые могут [**подтвердить предложенный вами перевод** документации](contributing.md#translations){.internal-link target=_blank}. Без них не было бы документации на многих языках.
+Итак, ревьюеры - это люди, которые могут [**подтвердить предложенный вами перевод** документации](contributing.md#_8){.internal-link target=_blank}. Без них не было бы документации на многих языках.
---
diff --git a/docs/ru/docs/features.md b/docs/ru/docs/features.md
index 110c7d31e..59860e12b 100644
--- a/docs/ru/docs/features.md
+++ b/docs/ru/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Основные свойства
## Основные свойства FastAPI
@@ -66,7 +71,7 @@ second_user_data = {
my_second_user: User = User(**second_user_data)
```
-!!! Информация
+!!! info "Информация"
`**second_user_data` означает:
Передать ключи и значения словаря `second_user_data`, в качестве аргументов типа "ключ-значение", это эквивалентно: `User(id=4, name="Mary", joined="2018-11-30")` .
diff --git a/docs/ru/docs/help-fastapi.md b/docs/ru/docs/help-fastapi.md
index 3ad3e6fd4..d53f501f5 100644
--- a/docs/ru/docs/help-fastapi.md
+++ b/docs/ru/docs/help-fastapi.md
@@ -73,7 +73,7 @@
Вы можете посмотреть, какие
проблемы испытывают другие люди и попытаться помочь им. Чаще всего это вопросы, на которые, весьма вероятно, Вы уже знаете ответ. 🤓
-Если Вы будете много помогать людям с решением их проблем, Вы можете стать официальным [Экспертом FastAPI](fastapi-people.md#experts){.internal-link target=_blank}. 🎉
+Если Вы будете много помогать людям с решением их проблем, Вы можете стать официальным [Экспертом FastAPI](fastapi-people.md#_3){.internal-link target=_blank}. 🎉
Только помните, самое важное при этом - доброта. Столкнувшись с проблемой, люди расстраиваются и часто задают вопросы не лучшим образом, но постарайтесь быть максимально доброжелательным. 🤗
@@ -162,7 +162,7 @@
* Затем, используя **комментарий**, сообщите, что Вы сделали проверку, тогда я буду знать, что Вы действительно проверили код.
-!!! Информация
+!!! info "Информация"
К сожалению, я не могу так просто доверять пул-реквестам, у которых уже есть несколько одобрений.
Бывали случаи, что пул-реквесты имели 3, 5 или больше одобрений, вероятно из-за привлекательного описания, но когда я проверял эти пул-реквесты, они оказывались сломаны, содержали ошибки или вовсе не решали проблему, которую, как они утверждали, должны были решить. 😅
@@ -190,7 +190,7 @@
* Исправить опечатку, которую Вы нашли в документации.
* Поделиться статьёй, видео или подкастом о FastAPI, которые Вы создали или нашли
изменив этот файл.
* Убедитесь, что Вы добавили свою ссылку в начало соответствующего раздела.
-* Помочь с [переводом документации](contributing.md#translations){.internal-link target=_blank} на Ваш язык.
+* Помочь с [переводом документации](contributing.md#_8){.internal-link target=_blank} на Ваш язык.
* Вы также можете проверять переводы сделанные другими.
* Предложить новые разделы документации.
* Исправить существующуе проблемы/баги.
@@ -207,8 +207,8 @@
Основные задачи, которые Вы можете выполнить прямо сейчас:
-* [Помочь другим с их проблемами на GitHub](#help-others-with-issues-in-github){.internal-link target=_blank} (смотрите вышестоящую секцию).
-* [Проверить пул-реквесты](#review-pull-requests){.internal-link target=_blank} (смотрите вышестоящую секцию).
+* [Помочь другим с их проблемами на GitHub](#github_1){.internal-link target=_blank} (смотрите вышестоящую секцию).
+* [Проверить пул-реквесты](#-){.internal-link target=_blank} (смотрите вышестоящую секцию).
Эти две задачи **отнимают больше всего времени**. Это основная работа по поддержке FastAPI.
@@ -218,8 +218,8 @@
Подключайтесь к 👥
чату в Discord 👥 и общайтесь с другими участниками сообщества FastAPI.
-!!! Подсказка
- Вопросы по проблемам с фреймворком лучше задавать в
GitHub issues, так больше шансов, что Вы получите помощь от [Экспертов FastAPI](fastapi-people.md#experts){.internal-link target=_blank}.
+!!! tip "Подсказка"
+ Вопросы по проблемам с фреймворком лучше задавать в
GitHub issues, так больше шансов, что Вы получите помощь от [Экспертов FastAPI](fastapi-people.md#_3){.internal-link target=_blank}.
Используйте этот чат только для бесед на отвлечённые темы.
@@ -229,7 +229,7 @@
В разделе "проблемы" на GitHub, есть шаблон, который поможет Вам написать вопрос правильно, чтобы Вам было легче получить хороший ответ или даже решить проблему самостоятельно, прежде чем Вы зададите вопрос. В GitHub я могу быть уверен, что всегда отвечаю на всё, даже если это займет какое-то время. И я не могу сделать то же самое в чатах. 😅
-Кроме того, общение в чатах не так легкодоступно для поиска, как в GitHub, потому вопросы и ответы могут потеряться среди другого общения. И только проблемы решаемые на GitHub учитываются в получении лычки [Эксперт FastAPI](fastapi-people.md#experts){.internal-link target=_blank}, так что весьма вероятно, что Вы получите больше внимания на GitHub.
+Кроме того, общение в чатах не так легкодоступно для поиска, как в GitHub, потому вопросы и ответы могут потеряться среди другого общения. И только проблемы решаемые на GitHub учитываются в получении лычки [Эксперт FastAPI](fastapi-people.md#_3){.internal-link target=_blank}, так что весьма вероятно, что Вы получите больше внимания на GitHub.
С другой стороны, в чатах тысячи пользователей, а значит есть большие шансы в любое время найти там кого-то, с кем можно поговорить. 😄
diff --git a/docs/ru/docs/index.md b/docs/ru/docs/index.md
index 477567af6..81c3835d9 100644
--- a/docs/ru/docs/index.md
+++ b/docs/ru/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -448,12 +457,12 @@ item: Item
*
python-multipart
- Обязательно, если вы хотите поддерживать форму
"парсинга" с помощью `request.form()`.
*
itsdangerous
- Обязательно, для поддержки `SessionMiddleware`.
*
pyyaml
- Обязательно, для поддержки `SchemaGenerator` Starlette (возможно, вам это не нужно с FastAPI).
-*
ujson
- Обязательно, если вы хотите использовать `UJSONResponse`.
Используется FastAPI / Starlette:
*
uvicorn
- сервер, который загружает и обслуживает ваше приложение.
*
orjson
- Обязательно, если вы хотите использовать `ORJSONResponse`.
+*
ujson
- Обязательно, если вы хотите использовать `UJSONResponse`.
Вы можете установить все это с помощью `pip install "fastapi[all]"`.
diff --git a/docs/ru/docs/tutorial/body-multiple-params.md b/docs/ru/docs/tutorial/body-multiple-params.md
index e52ef6f6f..ffba1d0f4 100644
--- a/docs/ru/docs/tutorial/body-multiple-params.md
+++ b/docs/ru/docs/tutorial/body-multiple-params.md
@@ -28,7 +28,7 @@
=== "Python 3.10+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="17-19"
@@ -37,14 +37,14 @@
=== "Python 3.8+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать версию с `Annotated`, если это возможно.
```Python hl_lines="19-21"
{!> ../../../docs_src/body_multiple_params/tutorial001.py!}
```
-!!! Заметка
+!!! note "Заметка"
Заметьте, что в данном случае параметр `item`, который будет взят из тела запроса, необязателен. Так как было установлено значение `None` по умолчанию.
## Несколько параметров тела запроса
@@ -93,7 +93,7 @@
}
```
-!!! Внимание
+!!! note "Внимание"
Обратите внимание, что хотя параметр `item` был объявлен таким же способом, как и раньше, теперь предпологается, что он находится внутри тела с ключом `item`.
@@ -131,7 +131,7 @@
=== "Python 3.10+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="20"
@@ -140,7 +140,7 @@
=== "Python 3.8+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="22"
@@ -205,7 +205,7 @@ q: str | None = None
=== "Python 3.10+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="25"
@@ -214,14 +214,14 @@ q: str | None = None
=== "Python 3.8+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="27"
{!> ../../../docs_src/body_multiple_params/tutorial004.py!}
```
-!!! Информация
+!!! info "Информация"
`Body` также имеет все те же дополнительные параметры валидации и метаданных, как у `Query`,`Path` и других, которые вы увидите позже.
## Добавление одного body-параметра
@@ -258,7 +258,7 @@ item: Item = Body(embed=True)
=== "Python 3.10+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="15"
@@ -267,7 +267,7 @@ item: Item = Body(embed=True)
=== "Python 3.8+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="17"
diff --git a/docs/ru/docs/tutorial/body.md b/docs/ru/docs/tutorial/body.md
index 96f80af06..5d0e033fd 100644
--- a/docs/ru/docs/tutorial/body.md
+++ b/docs/ru/docs/tutorial/body.md
@@ -162,4 +162,4 @@
## Без Pydantic
-Если вы не хотите использовать модели Pydantic, вы все еще можете использовать параметры **тела запроса**. Читайте в документации раздел [Тело - Несколько параметров: Единичные значения в теле](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
+Если вы не хотите использовать модели Pydantic, вы все еще можете использовать параметры **тела запроса**. Читайте в документации раздел [Тело - Несколько параметров: Единичные значения в теле](body-multiple-params.md#_2){.internal-link target=_blank}.
diff --git a/docs/ru/docs/tutorial/debugging.md b/docs/ru/docs/tutorial/debugging.md
index 38709e56d..5fc6a2c1f 100644
--- a/docs/ru/docs/tutorial/debugging.md
+++ b/docs/ru/docs/tutorial/debugging.md
@@ -74,7 +74,7 @@ from myapp import app
не будет выполнена.
-!!! Информация
+!!! info "Информация"
Для получения дополнительной информации, ознакомьтесь с
официальной документацией Python.
## Запуск вашего кода с помощью отладчика
diff --git a/docs/ru/docs/tutorial/dependencies/index.md b/docs/ru/docs/tutorial/dependencies/index.md
index ad6e835e5..9fce46b97 100644
--- a/docs/ru/docs/tutorial/dependencies/index.md
+++ b/docs/ru/docs/tutorial/dependencies/index.md
@@ -84,13 +84,13 @@
И в конце она возвращает `dict`, содержащий эти значения.
-!!! Информация
+!!! info "Информация"
**FastAPI** добавил поддержку для `Annotated` (и начал её рекомендовать) в версии 0.95.0.
Если у вас более старая версия, будут ошибки при попытке использовать `Annotated`.
- Убедитесь, что вы [Обновили FastAPI версию](../../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} до, как минимум 0.95.1, перед тем как использовать `Annotated`.
+ Убедитесь, что вы [Обновили FastAPI версию](../../deployment/versions.md#fastapi_2){.internal-link target=_blank} до, как минимум 0.95.1, перед тем как использовать `Annotated`.
### Import `Depends`
diff --git a/docs/ru/docs/tutorial/first-steps.md b/docs/ru/docs/tutorial/first-steps.md
index b46f235bc..8a0876bb4 100644
--- a/docs/ru/docs/tutorial/first-steps.md
+++ b/docs/ru/docs/tutorial/first-steps.md
@@ -310,7 +310,7 @@ https://example.com/items/foo
```
!!! note "Технические детали"
- Если не знаете в чём разница, посмотрите [Конкурентность: *"Нет времени?"*](../async.md#in-a-hurry){.internal-link target=_blank}.
+ Если не знаете в чём разница, посмотрите [Конкурентность: *"Нет времени?"*](../async.md#_1){.internal-link target=_blank}.
### Шаг 5: верните результат
diff --git a/docs/ru/docs/tutorial/metadata.md b/docs/ru/docs/tutorial/metadata.md
index 468e08917..0c6940d0e 100644
--- a/docs/ru/docs/tutorial/metadata.md
+++ b/docs/ru/docs/tutorial/metadata.md
@@ -65,7 +65,7 @@
```
!!! info "Дополнительная информация"
- Узнайте больше о тегах в [Конфигурации операции пути](path-operation-configuration.md#tags){.internal-link target=_blank}.
+ Узнайте больше о тегах в [Конфигурации операции пути](path-operation-configuration.md#_3){.internal-link target=_blank}.
### Проверьте документацию
diff --git a/docs/ru/docs/tutorial/path-params-numeric-validations.md b/docs/ru/docs/tutorial/path-params-numeric-validations.md
index bd2c29d0a..0baf51fa9 100644
--- a/docs/ru/docs/tutorial/path-params-numeric-validations.md
+++ b/docs/ru/docs/tutorial/path-params-numeric-validations.md
@@ -47,7 +47,7 @@
Если вы используете более старую версию, вы столкнётесь с ошибками при попытке использовать `Annotated`.
- Убедитесь, что вы [обновили версию FastAPI](../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} как минимум до 0.95.1 перед тем, как использовать `Annotated`.
+ Убедитесь, что вы [обновили версию FastAPI](../deployment/versions.md#fastapi_2){.internal-link target=_blank} как минимум до 0.95.1 перед тем, как использовать `Annotated`.
## Определите метаданные
diff --git a/docs/ru/docs/tutorial/query-params.md b/docs/ru/docs/tutorial/query-params.md
index 6e885cb65..f6e18f971 100644
--- a/docs/ru/docs/tutorial/query-params.md
+++ b/docs/ru/docs/tutorial/query-params.md
@@ -77,7 +77,7 @@ http://127.0.0.1:8000/items/?skip=20
В этом случае, параметр `q` будет не обязательным и будет иметь значение `None` по умолчанию.
-!!! Важно
+!!! check "Важно"
Также обратите внимание, что **FastAPI** достаточно умён чтобы заметить, что параметр `item_id` является path-параметром, а `q` нет, поэтому, это параметр запроса.
## Преобразование типа параметра запроса
@@ -221,5 +221,5 @@ http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
* `skip`, типа `int` и со значением по умолчанию `0`.
* `limit`, необязательный `int`.
-!!! подсказка
- Вы можете использовать класс `Enum` также, как ранее применяли его с [Path-параметрами](path-params.md#predefined-values){.internal-link target=_blank}.
+!!! tip "Подсказка"
+ Вы можете использовать класс `Enum` также, как ранее применяли его с [Path-параметрами](path-params.md#_7){.internal-link target=_blank}.
diff --git a/docs/ru/docs/tutorial/static-files.md b/docs/ru/docs/tutorial/static-files.md
index ec09eb5a3..afe2075d9 100644
--- a/docs/ru/docs/tutorial/static-files.md
+++ b/docs/ru/docs/tutorial/static-files.md
@@ -11,7 +11,7 @@
{!../../../docs_src/static_files/tutorial001.py!}
```
-!!! заметка "Технические детали"
+!!! note "Технические детали"
Вы также можете использовать `from starlette.staticfiles import StaticFiles`.
**FastAPI** предоставляет `starlette.staticfiles` под псевдонимом `fastapi.staticfiles`, просто для вашего удобства, как разработчика. Но на самом деле это берётся напрямую из библиотеки Starlette.
diff --git a/docs/ru/docs/tutorial/testing.md b/docs/ru/docs/tutorial/testing.md
index ca47a6f51..4772660df 100644
--- a/docs/ru/docs/tutorial/testing.md
+++ b/docs/ru/docs/tutorial/testing.md
@@ -50,7 +50,7 @@
### Файл приложения **FastAPI**
-Допустим, структура файлов Вашего приложения похожа на ту, что описана на странице [Более крупные приложения](./bigger-applications.md){.internal-link target=_blank}:
+Допустим, структура файлов Вашего приложения похожа на ту, что описана на странице [Более крупные приложения](bigger-applications.md){.internal-link target=_blank}:
```
.
diff --git a/docs/tr/docs/async.md b/docs/tr/docs/async.md
index aab939189..c7bedffd1 100644
--- a/docs/tr/docs/async.md
+++ b/docs/tr/docs/async.md
@@ -21,7 +21,7 @@ async def read_results():
return results
```
-!!! not
+!!! note "Not"
Sadece `async def` ile tanımlanan fonksiyonlar içinde `await` kullanabilirsiniz.
---
@@ -376,7 +376,7 @@ FastAPI'ye (Starlette aracılığıyla) güç veren ve bu kadar etkileyici bir p
Yukarıda açıklanan şekilde çalışmayan başka bir asenkron framework'den geliyorsanız ve küçük bir performans kazancı (yaklaşık 100 nanosaniye) için "def" ile *path fonksiyonu* tanımlamaya alışkınsanız, **FastAPI**'de tam tersi olacağını unutmayın. Bu durumlarda, *path fonksiyonu*
G/Ç engelleyen durum oluşturmadıkça "async def" kullanmak daha iyidir.
-Yine de, her iki durumda da, **FastAPI**'nin önceki frameworkden [hala daha hızlı](index.md#performance){.internal-link target=_blank} (veya en azından karşılaştırılabilir) olma olasılığı vardır.
+Yine de, her iki durumda da, **FastAPI**'nin önceki frameworkden [hala daha hızlı](index.md#performans){.internal-link target=_blank} (veya en azından karşılaştırılabilir) olma olasılığı vardır.
### Bagımlılıklar
diff --git a/docs/tr/docs/features.md b/docs/tr/docs/features.md
index 1cda8c7fb..b964aba4d 100644
--- a/docs/tr/docs/features.md
+++ b/docs/tr/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Özelikler
## FastAPI özellikleri
diff --git a/docs/tr/docs/index.md b/docs/tr/docs/index.md
index afbb27f7d..67a9b4462 100644
--- a/docs/tr/docs/index.md
+++ b/docs/tr/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -456,12 +465,12 @@ Starlette tarafında kullanılan:
*
python-multipart
- Eğer `request.form()` ile form
dönüşümü desteğini kullanacaksanız gereklidir.
*
itsdangerous
- `SessionMiddleware` desteği için gerekli.
*
pyyaml
- `SchemaGenerator` desteği için gerekli (Muhtemelen FastAPI kullanırken ihtiyacınız olmaz).
-*
ujson
- `UJSONResponse` kullanacaksanız gerekli.
Hem FastAPI hem de Starlette tarafından kullanılan:
*
uvicorn
- oluşturduğumuz uygulamayı servis edecek web sunucusu görevini üstlenir.
*
orjson
- `ORJSONResponse` kullanacaksanız gereklidir.
+*
ujson
- `UJSONResponse` kullanacaksanız gerekli.
Bunların hepsini `pip install fastapi[all]` ile yükleyebilirsin.
diff --git a/docs/tr/docs/python-types.md b/docs/tr/docs/python-types.md
index a0d32c86e..ac3111136 100644
--- a/docs/tr/docs/python-types.md
+++ b/docs/tr/docs/python-types.md
@@ -12,7 +12,7 @@ Bu pythonda tip belirteçleri için **hızlı bir başlangıç / bilgi tazeleme
**FastAPI** kullanmayacak olsanız bile tür belirteçleri hakkında bilgi edinmenizde fayda var.
-!!! not
+!!! note "Not"
Python uzmanıysanız ve tip belirteçleri ilgili her şeyi zaten biliyorsanız, sonraki bölüme geçin.
## Motivasyon
@@ -172,7 +172,7 @@ Liste, bazı dahili tipleri içeren bir tür olduğundan, bunları köşeli para
{!../../../docs_src/python_types/tutorial006.py!}
```
-!!! ipucu
+!!! tip "Ipucu"
Köşeli parantez içindeki bu dahili tiplere "tip parametreleri" denir.
Bu durumda `str`, `List`e iletilen tür parametresidir.
diff --git a/docs/tr/docs/tutorial/query-params.md b/docs/tr/docs/tutorial/query-params.md
index aa3915557..682f8332c 100644
--- a/docs/tr/docs/tutorial/query-params.md
+++ b/docs/tr/docs/tutorial/query-params.md
@@ -224,4 +224,4 @@ Bu durumda, 3 tane sorgu parametresi var olacaktır:
* `limit`, isteğe bağlı bir `int`.
!!! tip "İpucu"
- Ayrıca, [Yol Parametrelerinde](path-params.md#predefined-values){.internal-link target=_blank} de kullanıldığı şekilde `Enum` sınıfından faydalanabilirsiniz.
+ Ayrıca, [Yol Parametrelerinde](path-params.md#on-tanml-degerler){.internal-link target=_blank} de kullanıldığı şekilde `Enum` sınıfından faydalanabilirsiniz.
diff --git a/docs/uk/docs/alternatives.md b/docs/uk/docs/alternatives.md
index bdb62513e..16cc0d875 100644
--- a/docs/uk/docs/alternatives.md
+++ b/docs/uk/docs/alternatives.md
@@ -30,11 +30,11 @@
Це був один із перших прикладів **автоматичної документації API**, і саме це була одна з перших ідей, яка надихнула на «пошук» **FastAPI**.
-!!! Примітка
+!!! note "Примітка"
Django REST Framework створив Том Крісті. Той самий творець Starlette і Uvicorn, на яких базується **FastAPI**.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Мати автоматичний веб-інтерфейс документації API.
###
Flask
@@ -51,7 +51,7 @@ Flask — це «мікрофреймворк», він не включає ін
Враховуючи простоту Flask, він здавався хорошим підходом для створення API. Наступним, що знайшов, був «Django REST Framework» для Flask.
-!!! Переглянте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Бути мікрофреймоворком. Зробити легким комбінування та поєднання необхідних інструментів та частин.
Мати просту та легку у використанні систему маршрутизації.
@@ -91,7 +91,7 @@ def read_url():
Зверніть увагу на схожість у `requests.get(...)` і `@app.get(...)`.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
* Майте простий та інтуїтивно зрозумілий API.
* Використовуйте імена (операції) методів HTTP безпосередньо, простим та інтуїтивно зрозумілим способом.
* Розумні параметри за замовчуванням, але потужні налаштування.
@@ -109,7 +109,7 @@ def read_url():
Тому, коли говорять про версію 2.0, прийнято говорити «Swagger», а про версію 3+ «OpenAPI».
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Прийняти і використовувати відкритий стандарт для специфікацій API замість спеціальної схеми.
Інтегрувати інструменти інтерфейсу на основі стандартів:
@@ -135,7 +135,7 @@ Marshmallow створено для забезпечення цих функці
Але він був створений до того, як існували підказки типу Python. Отже, щоб визначити кожну
схему, вам потрібно використовувати спеціальні утиліти та класи, надані Marshmallow.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Використовувати код для автоматичного визначення "схем", які надають типи даних і перевірку.
###
Webargs
@@ -148,10 +148,10 @@ Webargs — це інструмент, створений, щоб забезпе
Це чудовий інструмент, і я також часто використовував його, перш ніж створити **FastAPI**.
-!!! Інформація
+!!! info "Інформація"
Webargs був створений тими ж розробниками Marshmallow.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Мати автоматичну перевірку даних вхідного запиту.
###
APISpec
@@ -172,11 +172,11 @@ Marshmallow і Webargs забезпечують перевірку, аналіз
Редактор тут нічим не може допомогти. І якщо ми змінимо параметри чи схеми Marshmallow і забудемо також змінити цю строку документа YAML, згенерована схема буде застарілою.
-!!! Інформація
+!!! info "Інформація"
APISpec був створений тими ж розробниками Marshmallow.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Підтримувати відкритий стандарт API, OpenAPI.
###
Flask-apispec
@@ -199,10 +199,10 @@ Marshmallow і Webargs забезпечують перевірку, аналіз
І ці самі генератори повного стеку були основою [**FastAPI** генераторів проектів](project-generation.md){.internal-link target=_blank}.
-!!! Інформація
+!!! info "Інформація"
Flask-apispec був створений тими ж розробниками Marshmallow.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Створення схеми OpenAPI автоматично з того самого коду, який визначає серіалізацію та перевірку.
###
NestJS (та
Angular)
@@ -219,7 +219,7 @@ Marshmallow і Webargs забезпечують перевірку, аналіз
Він не дуже добре обробляє вкладені моделі. Отже, якщо тіло JSON у запиті є об’єктом JSON із внутрішніми полями, які, у свою чергу, є вкладеними об’єктами JSON, його неможливо належним чином задокументувати та перевірити.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Використовувати типи Python, щоб мати чудову підтримку редактора.
Мати потужну систему впровадження залежностей. Знайдіть спосіб звести до мінімуму повторення коду.
@@ -228,12 +228,12 @@ Marshmallow і Webargs забезпечують перевірку, аналіз
Це був один із перших надзвичайно швидких фреймворків Python на основі `asyncio`. Він був дуже схожий на Flask.
-!!! Примітка "Технічні деталі"
+!!! note "Технічні деталі"
Він використовував
`uvloop` замість стандартного циклу Python `asyncio`. Ось що зробило його таким швидким.
Це явно надихнуло Uvicorn і Starlette, які зараз швидші за Sanic у відкритих тестах.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Знайти спосіб отримати божевільну продуктивність.
Ось чому **FastAPI** базується на Starlette, оскільки це найшвидша доступна структура (перевірена тестами сторонніх розробників).
@@ -246,7 +246,7 @@ Falcon — ще один високопродуктивний фреймворк
Таким чином, перевірка даних, серіалізація та документація повинні виконуватися в коді, а не автоматично. Або вони повинні бути реалізовані як фреймворк поверх Falcon, як Hug. Така сама відмінність спостерігається в інших фреймворках, натхненних дизайном Falcon, що мають один об’єкт запиту та один об’єкт відповіді як параметри.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Знайти способи отримати чудову продуктивність.
Разом із Hug (оскільки Hug базується на Falcon) надихнув **FastAPI** оголосити параметр `response` у функціях.
@@ -269,7 +269,7 @@ Falcon — ще один високопродуктивний фреймворк
Маршрути оголошуються в одному місці з використанням функцій, оголошених в інших місцях (замість використання декораторів, які можна розмістити безпосередньо поверх функції, яка обробляє кінцеву точку). Це ближче до того, як це робить Django, ніж до Flask (і Starlette). Він розділяє в коді речі, які відносно тісно пов’язані.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Визначити додаткові перевірки для типів даних, використовуючи значення "за замовчуванням" атрибутів моделі. Це покращує підтримку редактора, а раніше вона була недоступна в Pydantic.
Це фактично надихнуло оновити частини Pydantic, щоб підтримувати той самий стиль оголошення перевірки (всі ці функції вже доступні в Pydantic).
@@ -288,10 +288,10 @@ Hug був одним із перших фреймворків, який реа
Оскільки він заснований на попередньому стандарті для синхронних веб-фреймворків Python (WSGI), він не може працювати з Websockets та іншими речами, хоча він також має високу продуктивність.
-!!! Інформація
+!!! info "Інформація"
Hug створив Тімоті Крослі, той самий творець
`isort`, чудовий інструмент для автоматичного сортування імпорту у файлах Python.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Hug надихнув частину APIStar і був одним із найбільш перспективних інструментів, поряд із APIStar.
Hug надихнув **FastAPI** на використання підказок типу Python для оголошення параметрів і автоматичного створення схеми, що визначає API.
@@ -322,14 +322,14 @@ Hug був одним із перших фреймворків, який реа
Тепер APIStar — це набір інструментів для перевірки специфікацій OpenAPI, а не веб-фреймворк.
-!!! Інформація
+!!! info "Інформація"
APIStar створив Том Крісті. Той самий хлопець, який створив:
* Django REST Framework
* Starlette (на якому базується **FastAPI**)
* Uvicorn (використовується Starlette і **FastAPI**)
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Існувати.
Ідею оголошення кількох речей (перевірки даних, серіалізації та документації) за допомогою тих самих типів Python, які в той же час забезпечували чудову підтримку редактора, я вважав геніальною ідеєю.
@@ -348,7 +348,7 @@ Pydantic — це бібліотека для визначення переві
Його можна порівняти з Marshmallow. Хоча він швидший за Marshmallow у тестах. Оскільки він базується на тих самих підказках типу Python, підтримка редактора чудова.
-!!! Перегляньте "**FastAPI** використовує його для"
+!!! check "**FastAPI** використовує його для"
Виконання перевірки всіх даних, серіалізації даних і автоматичної документацію моделі (на основі схеми JSON).
Потім **FastAPI** бере ці дані схеми JSON і розміщує їх у OpenAPI, окремо від усіх інших речей, які він робить.
@@ -380,12 +380,12 @@ Starlette надає всі основні функції веб-мікрофр
Це одна з головних речей, які **FastAPI** додає зверху, все на основі підказок типу Python (з використанням Pydantic). Це, а також система впровадження залежностей, утиліти безпеки, створення схеми OpenAPI тощо.
-!!! Примітка "Технічні деталі"
+!!! note "Технічні деталі"
ASGI — це новий «стандарт», який розробляється членами основної команди Django. Це ще не «стандарт Python» (PEP), хоча вони в процесі цього.
Тим не менш, він уже використовується як «стандарт» кількома інструментами. Це значно покращує сумісність, оскільки ви можете переключити Uvicorn на будь-який інший сервер ASGI (наприклад, Daphne або Hypercorn), або ви можете додати інструменти, сумісні з ASGI, як-от `python-socketio`.
-!!! Перегляньте "**FastAPI** використовує його для"
+!!! check "**FastAPI** використовує його для"
Керування всіма основними веб-частинами. Додавання функцій зверху.
Сам клас `FastAPI` безпосередньо успадковує клас `Starlette`.
@@ -400,7 +400,7 @@ Uvicorn — це блискавичний сервер ASGI, побудован
Це рекомендований сервер для Starlette і **FastAPI**.
-!!! Перегляньте "**FastAPI** рекомендує це як"
+!!! check "**FastAPI** рекомендує це як"
Основний веб-сервер для запуску програм **FastAPI**.
Ви можете поєднати його з Gunicorn, щоб мати асинхронний багатопроцесний сервер.
diff --git a/docs/uk/docs/fastapi-people.md b/docs/uk/docs/fastapi-people.md
index f7d0220b5..152a7b098 100644
--- a/docs/uk/docs/fastapi-people.md
+++ b/docs/uk/docs/fastapi-people.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Люди FastAPI
FastAPI має дивовижну спільноту, яка вітає людей різного походження.
@@ -28,7 +33,7 @@ FastAPI має дивовижну спільноту, яка вітає люде
Це люди, які:
-* [Допомагають іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}.
+* [Допомагають іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank}.
* [Створюють пул реквести](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
* Переглядають пул реквести, [особливо важливо для перекладів](contributing.md#translations){.internal-link target=_blank}.
@@ -36,7 +41,7 @@ FastAPI має дивовижну спільноту, яка вітає люде
## Найбільш активні користувачі минулого місяця
-Це користувачі, які [найбільше допомагали іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} протягом минулого місяця. ☕
+Це користувачі, які [найбільше допомагали іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} протягом минулого місяця. ☕
{% if people %}
@@ -52,7 +57,7 @@ FastAPI має дивовижну спільноту, яка вітає люде
Ось **експерти FastAPI**. 🤓
-Це користувачі, які [найбільше допомагали іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} протягом *всього часу*.
+Це користувачі, які [найбільше допомагали іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} протягом *всього часу*.
Вони зарекомендували себе як експерти, допомагаючи багатьом іншим. ✨
diff --git a/docs/uk/docs/index.md b/docs/uk/docs/index.md
index 32f1f544a..bb21b68c2 100644
--- a/docs/uk/docs/index.md
+++ b/docs/uk/docs/index.md
@@ -451,12 +451,12 @@ Starlette використовує:
*
python-multipart
- Необхідно, якщо Ви хочете підтримувати
"розбір" форми за допомогою `request.form()`.
*
itsdangerous
- Необхідно для підтримки `SessionMiddleware`.
*
pyyaml
- Необхідно для підтримки Starlette `SchemaGenerator` (ймовірно, вам це не потрібно з FastAPI).
-*
ujson
- Необхідно, якщо Ви хочете використовувати `UJSONResponse`.
FastAPI / Starlette використовують:
*
uvicorn
- для сервера, який завантажує та обслуговує вашу програму.
*
orjson
- Необхідно, якщо Ви хочете використовувати `ORJSONResponse`.
+*
ujson
- Необхідно, якщо Ви хочете використовувати `UJSONResponse`.
Ви можете встановити все це за допомогою `pip install fastapi[all]`.
diff --git a/docs/uk/docs/python-types.md b/docs/uk/docs/python-types.md
index e767db2fb..d0adadff3 100644
--- a/docs/uk/docs/python-types.md
+++ b/docs/uk/docs/python-types.md
@@ -168,7 +168,7 @@ John Doe
З модуля `typing`, імпортуємо `List` (з великої літери `L`):
- ``` Python hl_lines="1"
+ ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!}
```
diff --git a/docs/uk/docs/tutorial/encoder.md b/docs/uk/docs/tutorial/encoder.md
index b6583341f..49321ff11 100644
--- a/docs/uk/docs/tutorial/encoder.md
+++ b/docs/uk/docs/tutorial/encoder.md
@@ -38,5 +38,5 @@
Вона не повертає велику строку `str`, яка містить дані у форматі JSON (як строка). Вона повертає стандартну структуру даних Python (наприклад `dict`) із значеннями та підзначеннями, які є сумісними з JSON.
-!!! Примітка
+!!! note "Примітка"
`jsonable_encoder` фактично використовується **FastAPI** внутрішньо для перетворення даних. Проте вона корисна в багатьох інших сценаріях.
diff --git a/docs/vi/docs/features.md b/docs/vi/docs/features.md
index 9edb1c8fa..fe75591dc 100644
--- a/docs/vi/docs/features.md
+++ b/docs/vi/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Tính năng
## Tính năng của FastAPI
diff --git a/docs/vi/docs/index.md b/docs/vi/docs/index.md
index 3ade853e2..652218afa 100644
--- a/docs/vi/docs/index.md
+++ b/docs/vi/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -31,7 +40,7 @@ FastAPI là một web framework hiện đại, hiệu năng cao để xây dựn
Những tính năng như:
-* **Nhanh**: Hiệu năng rất cao khi so sánh với **NodeJS** và **Go** (cảm ơn Starlette và Pydantic). [Một trong những Python framework nhanh nhất](#performance).
+* **Nhanh**: Hiệu năng rất cao khi so sánh với **NodeJS** và **Go** (cảm ơn Starlette và Pydantic). [Một trong những Python framework nhanh nhất](#hieu-nang).
* **Code nhanh**: Tăng tốc độ phát triển tính năng từ 200% tới 300%. *
* **Ít lỗi hơn**: Giảm khoảng 40% những lỗi phát sinh bởi con người (nhà phát triển). *
* **Trực giác tốt hơn**: Được các trình soạn thảo hỗ tuyệt vời.
Completion mọi nơi. Ít thời gian gỡ lỗi.
@@ -448,7 +457,6 @@ Independent TechEmpower benchmarks cho thấy các ứng dụng **FastAPI** ch
Sử dụng bởi Pydantic:
-*
ujson
-
"Parse" JSON nhanh hơn.
*
email_validator
- cho email validation.
Sử dụng Starlette:
@@ -458,12 +466,12 @@ Sử dụng Starlette:
*
python-multipart
- Bắt buộc nếu bạn muốn hỗ trợ
"parsing", form với `request.form()`.
*
itsdangerous
- Bắt buộc để hỗ trợ `SessionMiddleware`.
*
pyyaml
- Bắt buộc để hỗ trợ `SchemaGenerator` cho Starlette (bạn có thể không cần nó trong FastAPI).
-*
ujson
- Bắt buộc nếu bạn muốn sử dụng `UJSONResponse`.
Sử dụng bởi FastAPI / Starlette:
*
uvicorn
- Server để chạy ứng dụng của bạn.
*
orjson
- Bắt buộc nếu bạn muốn sử dụng `ORJSONResponse`.
+*
ujson
- Bắt buộc nếu bạn muốn sử dụng `UJSONResponse`.
Bạn có thể cài đặt tất cả những dependency trên với `pip install "fastapi[all]"`.
diff --git a/docs/vi/docs/python-types.md b/docs/vi/docs/python-types.md
index b2a399aa5..84d14de55 100644
--- a/docs/vi/docs/python-types.md
+++ b/docs/vi/docs/python-types.md
@@ -186,7 +186,7 @@ Ví dụ, hãy định nghĩa một biến là `list` các `str`.
Từ `typing`, import `List` (với chữ cái `L` viết hoa):
- ``` Python hl_lines="1"
+ ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!}
```
diff --git a/docs/yo/docs/index.md b/docs/yo/docs/index.md
index 5684f0a6a..352bf4df8 100644
--- a/docs/yo/docs/index.md
+++ b/docs/yo/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -31,7 +40,7 @@ FastAPI jẹ́ ìgbàlódé, tí ó yára (iṣẹ-giga), ìlànà wẹ́ẹ́b
Àwọn ẹya pàtàkì ni:
-* **Ó yára**: Iṣẹ tí ó ga púpọ̀, tí ó wa ni ibamu pẹ̀lú **NodeJS** àti **Go** (ọpẹ si Starlette àti Pydantic). [Ọkan nínú àwọn ìlànà Python ti o yára jùlọ ti o wa](#performance).
+* **Ó yára**: Iṣẹ tí ó ga púpọ̀, tí ó wa ni ibamu pẹ̀lú **NodeJS** àti **Go** (ọpẹ si Starlette àti Pydantic). [Ọkan nínú àwọn ìlànà Python ti o yára jùlọ ti o wa](#isesi).
* **Ó yára láti kóòdù**: O mu iyara pọ si láti kọ àwọn ẹya tuntun kóòdù nipasẹ "Igba ìdá ọgọ́rùn-ún" (i.e. 200%) si "ọ̀ọ́dúrún ìdá ọgọ́rùn-ún" (i.e. 300%).
* **Àìtọ́ kékeré**: O n din aṣiṣe ku bi ọgbon ìdá ọgọ́rùn-ún (i.e. 40%) ti eda eniyan (oṣiṣẹ kóòdù) fa. *
* **Ọgbọ́n àti ìmọ̀**: Atilẹyin olootu nla.
Ìparí nibi gbogbo. Àkókò díẹ̀ nipa wíwá ibi tí ìṣòro kóòdù wà.
@@ -456,12 +465,12 @@ Láti ní òye síi nípa rẹ̀, wo abala àwọn
python-multipart
- Nílò tí ó bá fẹ́ láti ṣe àtìlẹ́yìn fún
"àyẹ̀wò" fọọmu, pẹ̀lú `request.form()`.
*
itsdangerous
- Nílò fún àtìlẹ́yìn `SessionMiddleware`.
*
pyyaml
- Nílò fún àtìlẹ́yìn Starlette's `SchemaGenerator` (ó ṣe ṣe kí ó má nílò rẹ̀ fún FastAPI).
-*
ujson
- Nílò tí ó bá fẹ́ láti lọ `UJSONResponse`.
Èyí tí FastAPI / Starlette ń lò:
*
uvicorn
- Fún olupin tí yóò sẹ́ àmúyẹ àti tí yóò ṣe ìpèsè fún iṣẹ́ rẹ tàbí ohun èlò rẹ.
*
orjson
- Nílò tí ó bá fẹ́ láti lọ `ORJSONResponse`.
+*
ujson
- Nílò tí ó bá fẹ́ láti lọ `UJSONResponse`.
Ó lè fi gbogbo àwọn wọ̀nyí sórí ẹrọ pẹ̀lú `pip install "fastapi[all]"`.
diff --git a/docs/zh-hant/docs/index.md b/docs/zh-hant/docs/index.md
index 9859d3c51..f90eb2177 100644
--- a/docs/zh-hant/docs/index.md
+++ b/docs/zh-hant/docs/index.md
@@ -456,12 +456,12 @@ item: Item
-
python-multipart
- 需要使用 `request.form()` 對表單進行
"解析" 時安裝。
-
itsdangerous
- 需要使用 `SessionMiddleware` 支援時安裝。
-
pyyaml
- 用於支援 Starlette 的 `SchemaGenerator` (如果你使用 FastAPI,可能不需要它)。
--
ujson
- 使用 `UJSONResponse` 時必須安裝。
用於 FastAPI / Starlette:
-
uvicorn
- 用於加載和運行應用程式的服務器。
-
orjson
- 使用 `ORJSONResponse`時必須安裝。
+-
ujson
- 使用 `UJSONResponse` 時必須安裝。
你可以使用 `pip install "fastapi[all]"` 來安裝這些所有依賴套件。
diff --git a/docs/zh/docs/advanced/behind-a-proxy.md b/docs/zh/docs/advanced/behind-a-proxy.md
index 738bd7119..17fc2830a 100644
--- a/docs/zh/docs/advanced/behind-a-proxy.md
+++ b/docs/zh/docs/advanced/behind-a-proxy.md
@@ -346,6 +346,6 @@ $ uvicorn main:app --root-path /api/v1
## 挂载子应用
-如需挂载子应用(详见 [子应用 - 挂载](./sub-applications.md){.internal-link target=_blank}),也要通过 `root_path` 使用代理,这与正常应用一样,别无二致。
+如需挂载子应用(详见 [子应用 - 挂载](sub-applications.md){.internal-link target=_blank}),也要通过 `root_path` 使用代理,这与正常应用一样,别无二致。
FastAPI 在内部使用 `root_path`,因此子应用也可以正常运行。✨
diff --git a/docs/zh/docs/advanced/events.md b/docs/zh/docs/advanced/events.md
index 6017b8ef0..8e5fa7d12 100644
--- a/docs/zh/docs/advanced/events.md
+++ b/docs/zh/docs/advanced/events.md
@@ -6,7 +6,7 @@
!!! warning "警告"
- **FastAPI** 只执行主应用中的事件处理器,不执行[子应用 - 挂载](./sub-applications.md){.internal-link target=_blank}中的事件处理器。
+ **FastAPI** 只执行主应用中的事件处理器,不执行[子应用 - 挂载](sub-applications.md){.internal-link target=_blank}中的事件处理器。
## `startup` 事件
diff --git a/docs/zh/docs/advanced/response-headers.md b/docs/zh/docs/advanced/response-headers.md
index 85dab15ac..229efffcb 100644
--- a/docs/zh/docs/advanced/response-headers.md
+++ b/docs/zh/docs/advanced/response-headers.md
@@ -25,7 +25,7 @@
```
-!!! 注意 "技术细节"
+!!! note "技术细节"
你也可以使用`from starlette.responses import Response`或`from starlette.responses import JSONResponse`。
**FastAPI**提供了与`fastapi.responses`相同的`starlette.responses`,只是为了方便开发者。但是,大多数可用的响应都直接来自Starlette。
diff --git a/docs/zh/docs/advanced/sub-applications.md b/docs/zh/docs/advanced/sub-applications.md
index 55651def5..a26301b50 100644
--- a/docs/zh/docs/advanced/sub-applications.md
+++ b/docs/zh/docs/advanced/sub-applications.md
@@ -70,4 +70,4 @@ $ uvicorn main:app --reload
并且子应用还可以再挂载子应用,一切都会正常运行,FastAPI 可以自动处理所有 `root_path`。
-关于 `root_path` 及如何显式使用 `root_path` 的内容,详见[使用代理](./behind-a-proxy.md){.internal-link target=_blank}一章。
+关于 `root_path` 及如何显式使用 `root_path` 的内容,详见[使用代理](behind-a-proxy.md){.internal-link target=_blank}一章。
diff --git a/docs/zh/docs/advanced/wsgi.md b/docs/zh/docs/advanced/wsgi.md
index ad71280fc..179ec88aa 100644
--- a/docs/zh/docs/advanced/wsgi.md
+++ b/docs/zh/docs/advanced/wsgi.md
@@ -1,6 +1,6 @@
# 包含 WSGI - Flask,Django,其它
-您可以挂载多个 WSGI 应用,正如您在 [Sub Applications - Mounts](./sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](./behind-a-proxy.md){.internal-link target=_blank} 中所看到的那样。
+您可以挂载多个 WSGI 应用,正如您在 [Sub Applications - Mounts](sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank} 中所看到的那样。
为此, 您可以使用 `WSGIMiddleware` 来包装你的 WSGI 应用,如:Flask,Django,等等。
diff --git a/docs/zh/docs/async.md b/docs/zh/docs/async.md
index ed0e6e497..b34ef63e0 100644
--- a/docs/zh/docs/async.md
+++ b/docs/zh/docs/async.md
@@ -405,15 +405,15 @@ Starlette (和 **FastAPI**) 是基于
I/O 的代码。
-在这两种情况下,与您之前的框架相比,**FastAPI** 可能[仍然很快](index.md#performance){.internal-link target=_blank}。
+在这两种情况下,与您之前的框架相比,**FastAPI** 可能[仍然很快](index.md#_11){.internal-link target=_blank}。
### 依赖
-这同样适用于[依赖](./tutorial/dependencies/index.md){.internal-link target=_blank}。如果一个依赖是标准的 `def` 函数而不是 `async def`,它将被运行在外部线程池中。
+这同样适用于[依赖](tutorial/dependencies/index.md){.internal-link target=_blank}。如果一个依赖是标准的 `def` 函数而不是 `async def`,它将被运行在外部线程池中。
### 子依赖
-你可以拥有多个相互依赖的依赖以及[子依赖](./tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} (作为函数的参数),它们中的一些可能是通过 `async def` 声明,也可能是通过 `def` 声明。它们仍然可以正常工作,这些通过 `def` 声明的函数将会在外部线程中调用(来自线程池),而不是"被等待"。
+你可以拥有多个相互依赖的依赖以及[子依赖](tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} (作为函数的参数),它们中的一些可能是通过 `async def` 声明,也可能是通过 `def` 声明。它们仍然可以正常工作,这些通过 `def` 声明的函数将会在外部线程中调用(来自线程池),而不是"被等待"。
### 其他函数
diff --git a/docs/zh/docs/deployment/concepts.md b/docs/zh/docs/deployment/concepts.md
index 9c4aaa64b..86d995b75 100644
--- a/docs/zh/docs/deployment/concepts.md
+++ b/docs/zh/docs/deployment/concepts.md
@@ -25,7 +25,7 @@
## 安全性 - HTTPS
-在[上一章有关 HTTPS](./https.md){.internal-link target=_blank} 中,我们了解了 HTTPS 如何为您的 API 提供加密。
+在[上一章有关 HTTPS](https.md){.internal-link target=_blank} 中,我们了解了 HTTPS 如何为您的 API 提供加密。
我们还看到,HTTPS 通常由应用程序服务器的**外部**组件(**TLS 终止代理**)提供。
@@ -191,7 +191,7 @@
### 工作进程和端口
-还记得文档 [About HTTPS](./https.md){.internal-link target=_blank} 中只有一个进程可以侦听服务器中的端口和 IP 地址的一种组合吗?
+还记得文档 [About HTTPS](https.md){.internal-link target=_blank} 中只有一个进程可以侦听服务器中的端口和 IP 地址的一种组合吗?
现在仍然是对的。
@@ -249,7 +249,7 @@
如果这些关于 **容器**、Docker 或 Kubernetes 的内容还没有多大意义,请不要担心。
- 我将在以后的章节中向您详细介绍容器镜像、Docker、Kubernetes 等:[容器中的 FastAPI - Docker](./docker.md){.internal-link target=_blank}。
+ 我将在以后的章节中向您详细介绍容器镜像、Docker、Kubernetes 等:[容器中的 FastAPI - Docker](docker.md){.internal-link target=_blank}。
## 启动之前的步骤
@@ -284,7 +284,7 @@
!!! tip
- 我将在以后的章节中为您提供使用容器执行此操作的更具体示例:[容器中的 FastAPI - Docker](./docker.md){.internal-link target=_blank}。
+ 我将在以后的章节中为您提供使用容器执行此操作的更具体示例:[容器中的 FastAPI - Docker](docker.md){.internal-link target=_blank}。
## 资源利用率
diff --git a/docs/zh/docs/deployment/docker.md b/docs/zh/docs/deployment/docker.md
index 0f8906704..782c6d578 100644
--- a/docs/zh/docs/deployment/docker.md
+++ b/docs/zh/docs/deployment/docker.md
@@ -5,7 +5,7 @@
使用 Linux 容器有几个优点,包括**安全性**、**可复制性**、**简单性**等。
!!! tip
- 赶时间并且已经知道这些东西了? 跳转到下面的 [`Dockerfile` 👇](#为-fastapi-构建-docker-镜像)。
+ 赶时间并且已经知道这些东西了? 跳转到下面的 [`Dockerfile` 👇](#fastapi-docker_1)。
@@ -114,7 +114,7 @@ Docker 一直是创建和管理**容器镜像**和**容器**的主要工具之
最常见的方法是创建一个`requirements.txt`文件,其中每行包含一个包名称和它的版本。
-你当然也可以使用在[关于 FastAPI 版本](./versions.md){.internal-link target=_blank} 中讲到的方法来设置版本范围。
+你当然也可以使用在[关于 FastAPI 版本](versions.md){.internal-link target=_blank} 中讲到的方法来设置版本范围。
例如,你的`requirements.txt`可能如下所示:
@@ -208,7 +208,7 @@ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
`--no-cache-dir` 选项告诉 `pip` 不要在本地保存下载的包,因为只有当 `pip` 再次运行以安装相同的包时才会这样,但在与容器一起工作时情况并非如此。
- !!! 笔记
+ !!! note "笔记"
`--no-cache-dir` 仅与 `pip` 相关,与 Docker 或容器无关。
`--upgrade` 选项告诉 `pip` 升级软件包(如果已经安装)。
@@ -387,7 +387,7 @@ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
## 部署概念
-我们再谈谈容器方面的一些相同的[部署概念](./concepts.md){.internal-link target=_blank}。
+我们再谈谈容器方面的一些相同的[部署概念](concepts.md){.internal-link target=_blank}。
容器主要是一种简化**构建和部署**应用程序的过程的工具,但它们并不强制执行特定的方法来处理这些**部署概念**,并且有几种可能的策略。
@@ -537,7 +537,7 @@ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
## 带有 Gunicorn 的官方 Docker 镜像 - Uvicorn
-有一个官方 Docker 镜像,其中包含与 Uvicorn worker一起运行的 Gunicorn,如上一章所述:[服务器工作线程 - Gunicorn 与 Uvicorn](./server-workers.md){.internal-link target=_blank}。
+有一个官方 Docker 镜像,其中包含与 Uvicorn worker一起运行的 Gunicorn,如上一章所述:[服务器工作线程 - Gunicorn 与 Uvicorn](server-workers.md){.internal-link target=_blank}。
该镜像主要在上述情况下有用:[具有多个进程和特殊情况的容器](#containers-with-multiple-processes-and-special-cases)。
diff --git a/docs/zh/docs/deployment/server-workers.md b/docs/zh/docs/deployment/server-workers.md
index ee3de9b5d..330ddb3d7 100644
--- a/docs/zh/docs/deployment/server-workers.md
+++ b/docs/zh/docs/deployment/server-workers.md
@@ -13,12 +13,12 @@
部署应用程序时,您可能希望进行一些**进程复制**,以利用**多核**并能够处理更多请求。
-正如您在上一章有关[部署概念](./concepts.md){.internal-link target=_blank}中看到的,您可以使用多种策略。
+正如您在上一章有关[部署概念](concepts.md){.internal-link target=_blank}中看到的,您可以使用多种策略。
在这里我将向您展示如何将 **Gunicorn** 与 **Uvicorn worker 进程** 一起使用。
!!! info
- 如果您正在使用容器,例如 Docker 或 Kubernetes,我将在下一章中告诉您更多相关信息:[容器中的 FastAPI - Docker](./docker.md){.internal-link target=_blank}。
+ 如果您正在使用容器,例如 Docker 或 Kubernetes,我将在下一章中告诉您更多相关信息:[容器中的 FastAPI - Docker](docker.md){.internal-link target=_blank}。
特别是,当在 **Kubernetes** 上运行时,您可能**不想**使用 Gunicorn,而是运行 **每个容器一个 Uvicorn 进程**,但我将在本章后面告诉您这一点。
@@ -169,7 +169,7 @@ $ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
## 容器和 Docker
-在关于 [容器中的 FastAPI - Docker](./docker.md){.internal-link target=_blank} 的下一章中,我将介绍一些可用于处理其他 **部署概念** 的策略。
+在关于 [容器中的 FastAPI - Docker](docker.md){.internal-link target=_blank} 的下一章中,我将介绍一些可用于处理其他 **部署概念** 的策略。
我还将向您展示 **官方 Docker 镜像**,其中包括 **Gunicorn 和 Uvicorn worker** 以及一些对简单情况有用的默认配置。
diff --git a/docs/zh/docs/fastapi-people.md b/docs/zh/docs/fastapi-people.md
index 7ef3f3c1a..6cf35253c 100644
--- a/docs/zh/docs/fastapi-people.md
+++ b/docs/zh/docs/fastapi-people.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# FastAPI 社区
FastAPI 有一个非常棒的社区,它欢迎来自各个领域和背景的朋友。
@@ -18,7 +23,7 @@ FastAPI 有一个非常棒的社区,它欢迎来自各个领域和背景的朋
{% endif %}
-我是 **FastAPI** 的创建者和维护者. 你能在 [帮助 FastAPI - 获取帮助 - 与作者联系](help-fastapi.md#connect-with-the-author){.internal-link target=_blank} 阅读有关此内容的更多信息。
+我是 **FastAPI** 的创建者和维护者. 你能在 [帮助 FastAPI - 获取帮助 - 与作者联系](help-fastapi.md#_2){.internal-link target=_blank} 阅读有关此内容的更多信息。
...但是在这里我想向您展示社区。
@@ -28,15 +33,15 @@ FastAPI 有一个非常棒的社区,它欢迎来自各个领域和背景的朋
这些人:
-* [帮助他人解决 GitHub 的 issues](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}。
-* [创建 Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}。
-* 审核 Pull Requests, 对于 [翻译](contributing.md#translations){.internal-link target=_blank} 尤为重要。
+* [帮助他人解决 GitHub 的 issues](help-fastapi.md#github_1){.internal-link target=_blank}。
+* [创建 Pull Requests](help-fastapi.md#pr){.internal-link target=_blank}。
+* 审核 Pull Requests, 对于 [翻译](contributing.md#_8){.internal-link target=_blank} 尤为重要。
向他们致以掌声。 👏 🙇
## 上个月最活跃的用户
-上个月这些用户致力于 [帮助他人解决 GitHub 的 issues](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}。
+上个月这些用户致力于 [帮助他人解决 GitHub 的 issues](help-fastapi.md#github_1){.internal-link target=_blank}。
{% if people %}
@@ -52,7 +57,7 @@ FastAPI 有一个非常棒的社区,它欢迎来自各个领域和背景的朋
以下是 **FastAPI 专家**。 🤓
-这些用户一直以来致力于 [帮助他人解决 GitHub 的 issues](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}。
+这些用户一直以来致力于 [帮助他人解决 GitHub 的 issues](help-fastapi.md#github_1){.internal-link target=_blank}。
他们通过帮助许多人而被证明是专家。✨
@@ -70,7 +75,7 @@ FastAPI 有一个非常棒的社区,它欢迎来自各个领域和背景的朋
以下是 **杰出的贡献者**。 👷
-这些用户 [创建了最多已被合并的 Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}。
+这些用户 [创建了最多已被合并的 Pull Requests](help-fastapi.md#pr){.internal-link target=_blank}。
他们贡献了源代码,文档,翻译等。 📦
@@ -92,7 +97,7 @@ FastAPI 有一个非常棒的社区,它欢迎来自各个领域和背景的朋
### 翻译审核
-我只会说少数几种语言(而且还不是很流利 😅)。所以,具备[能力去批准文档翻译](contributing.md#translations){.internal-link target=_blank} 是这些评审者们。如果没有它们,就不会有多语言文档。
+我只会说少数几种语言(而且还不是很流利 😅)。所以,具备[能力去批准文档翻译](contributing.md#_8){.internal-link target=_blank} 是这些评审者们。如果没有它们,就不会有多语言文档。
---
diff --git a/docs/zh/docs/features.md b/docs/zh/docs/features.md
index d8190032f..b613aaf72 100644
--- a/docs/zh/docs/features.md
+++ b/docs/zh/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# 特性
## FastAPI 特性
diff --git a/docs/zh/docs/help-fastapi.md b/docs/zh/docs/help-fastapi.md
index 1a9aa57d0..d2a210c39 100644
--- a/docs/zh/docs/help-fastapi.md
+++ b/docs/zh/docs/help-fastapi.md
@@ -72,7 +72,7 @@
您可以查看
现有 issues,并尝试帮助其他人解决问题,说不定您能解决这些问题呢。🤓
-如果帮助很多人解决了问题,您就有可能成为 [FastAPI 的官方专家](fastapi-people.md#experts){.internal-link target=_blank}。🎉
+如果帮助很多人解决了问题,您就有可能成为 [FastAPI 的官方专家](fastapi-people.md#_3){.internal-link target=_blank}。🎉
## 监听 GitHub 资源库
@@ -98,7 +98,7 @@
* 修改文档错别字
*
编辑这个文件,分享 FastAPI 的文章、视频、博客,不论是您自己的,还是您看到的都成
* 注意,添加的链接要放在对应区块的开头
-* [翻译文档](contributing.md#translations){.internal-link target=_blank}
+* [翻译文档](contributing.md#_8){.internal-link target=_blank}
* 审阅别人翻译的文档
* 添加新的文档内容
* 修复现有问题/Bug
@@ -110,7 +110,7 @@
!!! tip "提示"
- 如有问题,请在
GitHub Issues 里提问,在这里更容易得到 [FastAPI 专家](fastapi-people.md#experts){.internal-link target=_blank}的帮助。
+ 如有问题,请在
GitHub Issues 里提问,在这里更容易得到 [FastAPI 专家](fastapi-people.md#_3){.internal-link target=_blank}的帮助。
聊天室仅供闲聊。
@@ -120,7 +120,7 @@
GitHub Issues 里提供了模板,指引您提出正确的问题,有利于获得优质的回答,甚至可能解决您还没有想到的问题。而且就算答疑解惑要耗费不少时间,我还是会尽量在 GitHub 里回答问题。但在聊天室里,我就没功夫这么做了。😅
-聊天室里的聊天内容也不如 GitHub 里好搜索,聊天里的问答很容易就找不到了。只有在 GitHub Issues 里的问答才能帮助您成为 [FastAPI 专家](fastapi-people.md#experts){.internal-link target=_blank},在 GitHub Issues 中为您带来更多关注。
+聊天室里的聊天内容也不如 GitHub 里好搜索,聊天里的问答很容易就找不到了。只有在 GitHub Issues 里的问答才能帮助您成为 [FastAPI 专家](fastapi-people.md#_3){.internal-link target=_blank},在 GitHub Issues 中为您带来更多关注。
另一方面,聊天室里有成千上万的用户,在这里,您有很大可能遇到聊得来的人。😄
diff --git a/docs/zh/docs/index.md b/docs/zh/docs/index.md
index a480d6640..2a67e8d08 100644
--- a/docs/zh/docs/index.md
+++ b/docs/zh/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -14,6 +23,9 @@
+
+
+
---
@@ -187,7 +199,7 @@ async def read_item(item_id: int, q: Union[str, None] = None):
**Note**:
-如果你不知道是否会用到,可以查看文档的 _"In a hurry?"_ 章节中
关于 `async` 和 `await` 的部分。
+如果你不知道是否会用到,可以查看文档的 _"In a hurry?"_ 章节中
关于 `async` 和 `await` 的部分。
@@ -410,7 +422,7 @@ item: Item

-
教程 - 用户指南 中有包含更多特性的更完整示例。
+
教程 - 用户指南 中有包含更多特性的更完整示例。
**剧透警告**: 教程 - 用户指南中的内容有:
@@ -431,7 +443,7 @@ item: Item
独立机构 TechEmpower 所作的基准测试结果显示,基于 Uvicorn 运行的 **FastAPI** 程序是
最快的 Python web 框架之一,仅次于 Starlette 和 Uvicorn 本身(FastAPI 内部使用了它们)。(*)
-想了解更多,请查阅
基准测试 章节。
+想了解更多,请查阅
基准测试 章节。
## 可选依赖
@@ -447,14 +459,14 @@ item: Item
*
itsdangerous
- 需要 `SessionMiddleware` 支持时安装。
*
pyyaml
- 使用 Starlette 提供的 `SchemaGenerator` 时安装(有 FastAPI 你可能并不需要它)。
*
graphene
- 需要 `GraphQLApp` 支持时安装。
-*
ujson
- 使用 `UJSONResponse` 时安装。
用于 FastAPI / Starlette:
*
uvicorn
- 用于加载和运行你的应用程序的服务器。
*
orjson
- 使用 `ORJSONResponse` 时安装。
+*
ujson
- 使用 `UJSONResponse` 时安装。
-你可以通过 `pip install fastapi[all]` 命令来安装以上所有依赖。
+你可以通过 `pip install "fastapi[all]"` 命令来安装以上所有依赖。
## 许可协议
diff --git a/docs/zh/docs/tutorial/bigger-applications.md b/docs/zh/docs/tutorial/bigger-applications.md
index 138959566..422cd7c16 100644
--- a/docs/zh/docs/tutorial/bigger-applications.md
+++ b/docs/zh/docs/tutorial/bigger-applications.md
@@ -119,7 +119,7 @@
!!! tip
我们正在使用虚构的请求首部来简化此示例。
- 但在实际情况下,使用集成的[安全性实用工具](./security/index.md){.internal-link target=_blank}会得到更好的效果。
+ 但在实际情况下,使用集成的[安全性实用工具](security/index.md){.internal-link target=_blank}会得到更好的效果。
## 其他使用 `APIRouter` 的模块
diff --git a/docs/zh/docs/tutorial/body-updates.md b/docs/zh/docs/tutorial/body-updates.md
index 43f20f8fc..e529fc914 100644
--- a/docs/zh/docs/tutorial/body-updates.md
+++ b/docs/zh/docs/tutorial/body-updates.md
@@ -34,7 +34,7 @@
即,只发送要更新的数据,其余数据保持不变。
-!!! Note "笔记"
+!!! note "笔记"
`PATCH` 没有 `PUT` 知名,也怎么不常用。
diff --git a/docs/zh/docs/tutorial/body.md b/docs/zh/docs/tutorial/body.md
index fa8b54d02..65d459cd1 100644
--- a/docs/zh/docs/tutorial/body.md
+++ b/docs/zh/docs/tutorial/body.md
@@ -213,4 +213,4 @@ Pydantic 模型的 JSON 概图是 OpenAPI 生成的概图部件,可在 API 文
## 不使用 Pydantic
-即便不使用 Pydantic 模型也能使用 **Body** 参数。详见[请求体 - 多参数:请求体中的单值](body-multiple-params.md#singular-values-in-body){.internal-link target=\_blank}。
+即便不使用 Pydantic 模型也能使用 **Body** 参数。详见[请求体 - 多参数:请求体中的单值](body-multiple-params.md#_2){.internal-link target=\_blank}。
diff --git a/docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md
index e24b9409f..4159d626e 100644
--- a/docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md
+++ b/docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -4,10 +4,10 @@ FastAPI支持在完成后执行一些
`httpx`.
例:`pip install httpx`.
@@ -27,7 +27,7 @@
{!../../../docs_src/app_testing/tutorial001.py!}
```
-!!! 提示
+!!! tip "提示"
注意测试函数是普通的 `def`,不是 `async def`。
还有client的调用也是普通的调用,不是用 `await`。
@@ -39,7 +39,7 @@
**FastAPI** 提供了和 `starlette.testclient` 一样的 `fastapi.testclient`,只是为了方便开发者。但它直接来自Starlette。
-!!! 提示
+!!! tip "提示"
除了发送请求之外,如果你还想测试时在FastAPI应用中调用 `async` 函数(例如异步数据库函数), 可以在高级教程中看下 [Async Tests](../advanced/async-tests.md){.internal-link target=_blank} 。
## 分离测试
@@ -50,7 +50,7 @@
### **FastAPI** app 文件
-假设你有一个像 [更大的应用](./bigger-applications.md){.internal-link target=_blank} 中所描述的文件结构:
+假设你有一个像 [更大的应用](bigger-applications.md){.internal-link target=_blank} 中所描述的文件结构:
```
.
@@ -130,7 +130,7 @@
=== "Python 3.10+ non-Annotated"
- !!! tip
+ !!! tip "提示"
Prefer to use the `Annotated` version if possible.
```Python
@@ -139,7 +139,7 @@
=== "Python 3.8+ non-Annotated"
- !!! tip
+ !!! tip "提示"
Prefer to use the `Annotated` version if possible.
```Python
@@ -168,7 +168,7 @@
关于如何传数据给后端的更多信息 (使用`httpx` 或 `TestClient`),请查阅 HTTPX 文档.
-!!! 信息
+!!! info "信息"
注意 `TestClient` 接收可以被转化为JSON的数据,而不是Pydantic模型。
如果你在测试中有一个Pydantic模型,并且你想在测试时发送它的数据给应用,你可以使用在[JSON Compatible Encoder](encoder.md){.internal-link target=_blank}介绍的`jsonable_encoder` 。
diff --git a/docs_src/extra_data_types/tutorial001.py b/docs_src/extra_data_types/tutorial001.py
index 8ae8472a7..71de958ff 100644
--- a/docs_src/extra_data_types/tutorial001.py
+++ b/docs_src/extra_data_types/tutorial001.py
@@ -10,10 +10,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: Union[datetime, None] = Body(default=None),
- end_datetime: Union[datetime, None] = Body(default=None),
+ start_datetime: datetime = Body(),
+ end_datetime: datetime = Body(),
+ process_after: timedelta = Body(),
repeat_at: Union[time, None] = Body(default=None),
- process_after: Union[timedelta, None] = Body(default=None),
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -21,8 +21,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/extra_data_types/tutorial001_an.py b/docs_src/extra_data_types/tutorial001_an.py
index a4c074241..257d0c7c8 100644
--- a/docs_src/extra_data_types/tutorial001_an.py
+++ b/docs_src/extra_data_types/tutorial001_an.py
@@ -11,10 +11,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: Annotated[Union[datetime, None], Body()] = None,
- end_datetime: Annotated[Union[datetime, None], Body()] = None,
+ start_datetime: Annotated[datetime, Body()],
+ end_datetime: Annotated[datetime, Body()],
+ process_after: Annotated[timedelta, Body()],
repeat_at: Annotated[Union[time, None], Body()] = None,
- process_after: Annotated[Union[timedelta, None], Body()] = None,
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -22,8 +22,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/extra_data_types/tutorial001_an_py310.py b/docs_src/extra_data_types/tutorial001_an_py310.py
index 4f69c40d9..668bf1909 100644
--- a/docs_src/extra_data_types/tutorial001_an_py310.py
+++ b/docs_src/extra_data_types/tutorial001_an_py310.py
@@ -10,10 +10,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: Annotated[datetime | None, Body()] = None,
- end_datetime: Annotated[datetime | None, Body()] = None,
+ start_datetime: Annotated[datetime, Body()],
+ end_datetime: Annotated[datetime, Body()],
+ process_after: Annotated[timedelta, Body()],
repeat_at: Annotated[time | None, Body()] = None,
- process_after: Annotated[timedelta | None, Body()] = None,
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -21,8 +21,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/extra_data_types/tutorial001_an_py39.py b/docs_src/extra_data_types/tutorial001_an_py39.py
index 630d36ae3..fa3551d66 100644
--- a/docs_src/extra_data_types/tutorial001_an_py39.py
+++ b/docs_src/extra_data_types/tutorial001_an_py39.py
@@ -10,10 +10,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: Annotated[Union[datetime, None], Body()] = None,
- end_datetime: Annotated[Union[datetime, None], Body()] = None,
+ start_datetime: Annotated[datetime, Body()],
+ end_datetime: Annotated[datetime, Body()],
+ process_after: Annotated[timedelta, Body()],
repeat_at: Annotated[Union[time, None], Body()] = None,
- process_after: Annotated[Union[timedelta, None], Body()] = None,
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -21,8 +21,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/extra_data_types/tutorial001_py310.py b/docs_src/extra_data_types/tutorial001_py310.py
index d22f81888..a275a0577 100644
--- a/docs_src/extra_data_types/tutorial001_py310.py
+++ b/docs_src/extra_data_types/tutorial001_py310.py
@@ -9,10 +9,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: datetime | None = Body(default=None),
- end_datetime: datetime | None = Body(default=None),
+ start_datetime: datetime = Body(),
+ end_datetime: datetime = Body(),
+ process_after: timedelta = Body(),
repeat_at: time | None = Body(default=None),
- process_after: timedelta | None = Body(default=None),
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -20,8 +20,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/path_operation_advanced_configuration/tutorial007.py b/docs_src/path_operation_advanced_configuration/tutorial007.py
index 972ddbd2c..54e2e9399 100644
--- a/docs_src/path_operation_advanced_configuration/tutorial007.py
+++ b/docs_src/path_operation_advanced_configuration/tutorial007.py
@@ -30,5 +30,5 @@ async def create_item(request: Request):
try:
item = Item.model_validate(data)
except ValidationError as e:
- raise HTTPException(status_code=422, detail=e.errors())
+ raise HTTPException(status_code=422, detail=e.errors(include_url=False))
return item
diff --git a/fastapi/__init__.py b/fastapi/__init__.py
index 5a77101fb..f28657712 100644
--- a/fastapi/__init__.py
+++ b/fastapi/__init__.py
@@ -1,6 +1,6 @@
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
-__version__ = "0.110.1"
+__version__ = "0.110.2"
from starlette import status as status
diff --git a/fastapi/_compat.py b/fastapi/_compat.py
index 35d4a8723..06b847b4f 100644
--- a/fastapi/_compat.py
+++ b/fastapi/_compat.py
@@ -20,10 +20,12 @@ from typing import (
from fastapi.exceptions import RequestErrorModel
from fastapi.types import IncEx, ModelNameMap, UnionType
from pydantic import BaseModel, create_model
-from pydantic.version import VERSION as PYDANTIC_VERSION
+from pydantic.version import VERSION as P_VERSION
from starlette.datastructures import UploadFile
from typing_extensions import Annotated, Literal, get_args, get_origin
+# Reassign variable to make it reexported for mypy
+PYDANTIC_VERSION = P_VERSION
PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
@@ -127,7 +129,7 @@ if PYDANTIC_V2:
)
except ValidationError as exc:
return None, _regenerate_error_with_loc(
- errors=exc.errors(), loc_prefix=loc
+ errors=exc.errors(include_url=False), loc_prefix=loc
)
def serialize(
@@ -266,7 +268,7 @@ if PYDANTIC_V2:
def get_missing_field_error(loc: Tuple[str, ...]) -> Dict[str, Any]:
error = ValidationError.from_exception_data(
"Field required", [{"type": "missing", "loc": loc, "input": {}}]
- ).errors()[0]
+ ).errors(include_url=False)[0]
error["input"] = None
return error # type: ignore[return-value]
diff --git a/fastapi/encoders.py b/fastapi/encoders.py
index 2f9c4a4f7..451ea0760 100644
--- a/fastapi/encoders.py
+++ b/fastapi/encoders.py
@@ -24,7 +24,7 @@ from pydantic.networks import AnyUrl, NameEmail
from pydantic.types import SecretBytes, SecretStr
from typing_extensions import Annotated, Doc
-from ._compat import PYDANTIC_V2, Url, _model_dump
+from ._compat import PYDANTIC_V2, UndefinedType, Url, _model_dump
# Taken from Pydantic v1 as is
@@ -259,6 +259,8 @@ def jsonable_encoder(
return str(obj)
if isinstance(obj, (str, int, float, type(None))):
return obj
+ if isinstance(obj, UndefinedType):
+ return None
if isinstance(obj, dict):
encoded_dict = {}
allowed_keys = set(obj.keys())
diff --git a/fastapi/openapi/models.py b/fastapi/openapi/models.py
index 5f3bdbb20..ed07b40f5 100644
--- a/fastapi/openapi/models.py
+++ b/fastapi/openapi/models.py
@@ -55,11 +55,7 @@ except ImportError: # pragma: no cover
return with_info_plain_validator_function(cls._validate)
-class Contact(BaseModel):
- name: Optional[str] = None
- url: Optional[AnyUrl] = None
- email: Optional[EmailStr] = None
-
+class BaseModelWithConfig(BaseModel):
if PYDANTIC_V2:
model_config = {"extra": "allow"}
@@ -69,21 +65,19 @@ class Contact(BaseModel):
extra = "allow"
-class License(BaseModel):
- name: str
- identifier: Optional[str] = None
+class Contact(BaseModelWithConfig):
+ name: Optional[str] = None
url: Optional[AnyUrl] = None
+ email: Optional[EmailStr] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
- class Config:
- extra = "allow"
+class License(BaseModelWithConfig):
+ name: str
+ identifier: Optional[str] = None
+ url: Optional[AnyUrl] = None
-class Info(BaseModel):
+class Info(BaseModelWithConfig):
title: str
summary: Optional[str] = None
description: Optional[str] = None
@@ -92,42 +86,18 @@ class Info(BaseModel):
license: Optional[License] = None
version: str
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
- class Config:
- extra = "allow"
-
-
-class ServerVariable(BaseModel):
+class ServerVariable(BaseModelWithConfig):
enum: Annotated[Optional[List[str]], Field(min_length=1)] = None
default: str
description: Optional[str] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
- class Config:
- extra = "allow"
-
-
-class Server(BaseModel):
+class Server(BaseModelWithConfig):
url: Union[AnyUrl, str]
description: Optional[str] = None
variables: Optional[Dict[str, ServerVariable]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class Reference(BaseModel):
ref: str = Field(alias="$ref")
@@ -138,36 +108,20 @@ class Discriminator(BaseModel):
mapping: Optional[Dict[str, str]] = None
-class XML(BaseModel):
+class XML(BaseModelWithConfig):
name: Optional[str] = None
namespace: Optional[str] = None
prefix: Optional[str] = None
attribute: Optional[bool] = None
wrapped: Optional[bool] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
- class Config:
- extra = "allow"
-
-
-class ExternalDocumentation(BaseModel):
+class ExternalDocumentation(BaseModelWithConfig):
description: Optional[str] = None
url: AnyUrl
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
-class Schema(BaseModel):
+class Schema(BaseModelWithConfig):
# Ref: JSON Schema 2020-12: https://json-schema.org/draft/2020-12/json-schema-core.html#name-the-json-schema-core-vocabu
# Core Vocabulary
schema_: Optional[str] = Field(default=None, alias="$schema")
@@ -253,14 +207,6 @@ class Schema(BaseModel):
),
] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
# Ref: https://json-schema.org/draft/2020-12/json-schema-core.html#name-json-schema-documents
# A JSON Schema MUST be an object or a boolean.
@@ -289,38 +235,22 @@ class ParameterInType(Enum):
cookie = "cookie"
-class Encoding(BaseModel):
+class Encoding(BaseModelWithConfig):
contentType: Optional[str] = None
headers: Optional[Dict[str, Union["Header", Reference]]] = None
style: Optional[str] = None
explode: Optional[bool] = None
allowReserved: Optional[bool] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
-class MediaType(BaseModel):
+class MediaType(BaseModelWithConfig):
schema_: Optional[Union[Schema, Reference]] = Field(default=None, alias="schema")
example: Optional[Any] = None
examples: Optional[Dict[str, Union[Example, Reference]]] = None
encoding: Optional[Dict[str, Encoding]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
-class ParameterBase(BaseModel):
+class ParameterBase(BaseModelWithConfig):
description: Optional[str] = None
required: Optional[bool] = None
deprecated: Optional[bool] = None
@@ -334,14 +264,6 @@ class ParameterBase(BaseModel):
# Serialization rules for more complex scenarios
content: Optional[Dict[str, MediaType]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class Parameter(ParameterBase):
name: str
@@ -352,21 +274,13 @@ class Header(ParameterBase):
pass
-class RequestBody(BaseModel):
+class RequestBody(BaseModelWithConfig):
description: Optional[str] = None
content: Dict[str, MediaType]
required: Optional[bool] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
- class Config:
- extra = "allow"
-
-
-class Link(BaseModel):
+class Link(BaseModelWithConfig):
operationRef: Optional[str] = None
operationId: Optional[str] = None
parameters: Optional[Dict[str, Union[Any, str]]] = None
@@ -374,31 +288,15 @@ class Link(BaseModel):
description: Optional[str] = None
server: Optional[Server] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
-class Response(BaseModel):
+class Response(BaseModelWithConfig):
description: str
headers: Optional[Dict[str, Union[Header, Reference]]] = None
content: Optional[Dict[str, MediaType]] = None
links: Optional[Dict[str, Union[Link, Reference]]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
-class Operation(BaseModel):
+class Operation(BaseModelWithConfig):
tags: Optional[List[str]] = None
summary: Optional[str] = None
description: Optional[str] = None
@@ -413,16 +311,8 @@ class Operation(BaseModel):
security: Optional[List[Dict[str, List[str]]]] = None
servers: Optional[List[Server]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
- class Config:
- extra = "allow"
-
-
-class PathItem(BaseModel):
+class PathItem(BaseModelWithConfig):
ref: Optional[str] = Field(default=None, alias="$ref")
summary: Optional[str] = None
description: Optional[str] = None
@@ -437,14 +327,6 @@ class PathItem(BaseModel):
servers: Optional[List[Server]] = None
parameters: Optional[List[Union[Parameter, Reference]]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class SecuritySchemeType(Enum):
apiKey = "apiKey"
@@ -453,18 +335,10 @@ class SecuritySchemeType(Enum):
openIdConnect = "openIdConnect"
-class SecurityBase(BaseModel):
+class SecurityBase(BaseModelWithConfig):
type_: SecuritySchemeType = Field(alias="type")
description: Optional[str] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class APIKeyIn(Enum):
query = "query"
@@ -488,18 +362,10 @@ class HTTPBearer(HTTPBase):
bearerFormat: Optional[str] = None
-class OAuthFlow(BaseModel):
+class OAuthFlow(BaseModelWithConfig):
refreshUrl: Optional[str] = None
scopes: Dict[str, str] = {}
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class OAuthFlowImplicit(OAuthFlow):
authorizationUrl: str
@@ -518,20 +384,12 @@ class OAuthFlowAuthorizationCode(OAuthFlow):
tokenUrl: str
-class OAuthFlows(BaseModel):
+class OAuthFlows(BaseModelWithConfig):
implicit: Optional[OAuthFlowImplicit] = None
password: Optional[OAuthFlowPassword] = None
clientCredentials: Optional[OAuthFlowClientCredentials] = None
authorizationCode: Optional[OAuthFlowAuthorizationCode] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class OAuth2(SecurityBase):
type_: SecuritySchemeType = Field(default=SecuritySchemeType.oauth2, alias="type")
@@ -548,7 +406,7 @@ class OpenIdConnect(SecurityBase):
SecurityScheme = Union[APIKey, HTTPBase, OAuth2, OpenIdConnect, HTTPBearer]
-class Components(BaseModel):
+class Components(BaseModelWithConfig):
schemas: Optional[Dict[str, Union[Schema, Reference]]] = None
responses: Optional[Dict[str, Union[Response, Reference]]] = None
parameters: Optional[Dict[str, Union[Parameter, Reference]]] = None
@@ -561,30 +419,14 @@ class Components(BaseModel):
callbacks: Optional[Dict[str, Union[Dict[str, PathItem], Reference, Any]]] = None
pathItems: Optional[Dict[str, Union[PathItem, Reference]]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
-class Tag(BaseModel):
+class Tag(BaseModelWithConfig):
name: str
description: Optional[str] = None
externalDocs: Optional[ExternalDocumentation] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
-class OpenAPI(BaseModel):
+class OpenAPI(BaseModelWithConfig):
openapi: str
info: Info
jsonSchemaDialect: Optional[str] = None
@@ -597,14 +439,6 @@ class OpenAPI(BaseModel):
tags: Optional[List[Tag]] = None
externalDocs: Optional[ExternalDocumentation] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
_model_rebuild(Schema)
_model_rebuild(Operation)
diff --git a/fastapi/openapi/utils.py b/fastapi/openapi/utils.py
index 5bfb5acef..79ad9f83f 100644
--- a/fastapi/openapi/utils.py
+++ b/fastapi/openapi/utils.py
@@ -123,7 +123,7 @@ def get_openapi_operation_parameters(
elif field_info.example != Undefined:
parameter["example"] = jsonable_encoder(field_info.example)
if field_info.deprecated:
- parameter["deprecated"] = field_info.deprecated
+ parameter["deprecated"] = True
parameters.append(parameter)
return parameters
diff --git a/fastapi/param_functions.py b/fastapi/param_functions.py
index 6722a7d66..3b25d774a 100644
--- a/fastapi/param_functions.py
+++ b/fastapi/param_functions.py
@@ -240,7 +240,7 @@ def Path( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -565,7 +565,7 @@ def Query( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -880,7 +880,7 @@ def Header( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -1185,7 +1185,7 @@ def Cookie( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -1512,7 +1512,7 @@ def Body( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -1827,7 +1827,7 @@ def Form( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -2141,7 +2141,7 @@ def File( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
diff --git a/fastapi/params.py b/fastapi/params.py
index b40944dba..860146531 100644
--- a/fastapi/params.py
+++ b/fastapi/params.py
@@ -6,7 +6,7 @@ from fastapi.openapi.models import Example
from pydantic.fields import FieldInfo
from typing_extensions import Annotated, deprecated
-from ._compat import PYDANTIC_V2, Undefined
+from ._compat import PYDANTIC_V2, PYDANTIC_VERSION, Undefined
_Unset: Any = Undefined
@@ -63,12 +63,11 @@ class Param(FieldInfo):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
):
- self.deprecated = deprecated
if example is not _Unset:
warnings.warn(
"`example` has been deprecated, please use `examples` instead",
@@ -106,6 +105,10 @@ class Param(FieldInfo):
stacklevel=4,
)
current_json_schema_extra = json_schema_extra or extra
+ if PYDANTIC_VERSION < "2.7.0":
+ self.deprecated = deprecated
+ else:
+ kwargs["deprecated"] = deprecated
if PYDANTIC_V2:
kwargs.update(
{
@@ -174,7 +177,7 @@ class Path(Param):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -260,7 +263,7 @@ class Query(Param):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -345,7 +348,7 @@ class Header(Param):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -430,7 +433,7 @@ class Cookie(Param):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -514,14 +517,13 @@ class Body(FieldInfo):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
):
self.embed = embed
self.media_type = media_type
- self.deprecated = deprecated
if example is not _Unset:
warnings.warn(
"`example` has been deprecated, please use `examples` instead",
@@ -559,6 +561,10 @@ class Body(FieldInfo):
stacklevel=4,
)
current_json_schema_extra = json_schema_extra or extra
+ if PYDANTIC_VERSION < "2.7.0":
+ self.deprecated = deprecated
+ else:
+ kwargs["deprecated"] = deprecated
if PYDANTIC_V2:
kwargs.update(
{
@@ -627,7 +633,7 @@ class Form(Body):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -712,7 +718,7 @@ class File(Form):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
diff --git a/fastapi/security/http.py b/fastapi/security/http.py
index b45bee55c..a142b135d 100644
--- a/fastapi/security/http.py
+++ b/fastapi/security/http.py
@@ -15,7 +15,7 @@ from typing_extensions import Annotated, Doc
class HTTPBasicCredentials(BaseModel):
"""
- The HTTP Basic credendials given as the result of using `HTTPBasic` in a
+ The HTTP Basic credentials given as the result of using `HTTPBasic` in a
dependency.
Read more about it in the
diff --git a/fastapi/utils.py b/fastapi/utils.py
index 53b2fa0c3..dfda4e678 100644
--- a/fastapi/utils.py
+++ b/fastapi/utils.py
@@ -221,9 +221,3 @@ def get_value_or_default(
if not isinstance(item, DefaultPlaceholder):
return item
return first_item
-
-
-def match_pydantic_error_url(error_type: str) -> Any:
- from dirty_equals import IsStr
-
- return IsStr(regex=rf"^https://errors\.pydantic\.dev/.*/v/{error_type}")
diff --git a/requirements-docs.txt b/requirements-docs.txt
index 8fa64cf39..599e01f16 100644
--- a/requirements-docs.txt
+++ b/requirements-docs.txt
@@ -1,6 +1,6 @@
-e .
-r requirements-docs-tests.txt
-mkdocs-material==9.4.7
+mkdocs-material==9.5.18
mdx-include >=1.4.1,<2.0.0
mkdocs-redirects>=1.2.1,<1.3.0
typer >=0.12.0
@@ -8,7 +8,7 @@ pyyaml >=5.3.1,<7.0.0
# For Material for MkDocs, Chinese search
jieba==0.42.1
# For image processing by Material for MkDocs
-pillow==10.2.0
+pillow==10.3.0
# For image processing by Material for MkDocs
cairosvg==2.7.0
mkdocstrings[python]==0.23.0
diff --git a/tests/main.py b/tests/main.py
index 15760c039..6927eab61 100644
--- a/tests/main.py
+++ b/tests/main.py
@@ -1,5 +1,5 @@
import http
-from typing import FrozenSet, Optional
+from typing import FrozenSet, List, Optional
from fastapi import FastAPI, Path, Query
@@ -192,3 +192,13 @@ def get_enum_status_code():
@app.get("/query/frozenset")
def get_query_type_frozenset(query: FrozenSet[int] = Query(...)):
return ",".join(map(str, sorted(query)))
+
+
+@app.get("/query/list")
+def get_query_list(device_ids: List[int] = Query()) -> List[int]:
+ return device_ids
+
+
+@app.get("/query/list-default")
+def get_query_list_default(device_ids: List[int] = Query(default=[])) -> List[int]:
+ return device_ids
diff --git a/tests/test_annotated.py b/tests/test_annotated.py
index 2222be978..473d33e52 100644
--- a/tests/test_annotated.py
+++ b/tests/test_annotated.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import APIRouter, FastAPI, Query
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from typing_extensions import Annotated
app = FastAPI()
@@ -38,7 +37,6 @@ foo_is_missing = {
"msg": "Field required",
"type": "missing",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
)
# TODO: remove when deprecating Pydantic v1
@@ -60,7 +58,6 @@ foo_is_short = {
"msg": "String should have at least 1 character",
"type": "string_too_short",
"input": "",
- "url": match_pydantic_error_url("string_too_short"),
}
)
# TODO: remove when deprecating Pydantic v1
diff --git a/tests/test_application.py b/tests/test_application.py
index ea7a80128..5c62f5f6e 100644
--- a/tests/test_application.py
+++ b/tests/test_application.py
@@ -1163,6 +1163,91 @@ def test_openapi_schema():
},
}
},
+ "/query/list": {
+ "get": {
+ "summary": "Get Query List",
+ "operationId": "get_query_list_query_list_get",
+ "parameters": [
+ {
+ "name": "device_ids",
+ "in": "query",
+ "required": True,
+ "schema": {
+ "type": "array",
+ "items": {"type": "integer"},
+ "title": "Device Ids",
+ },
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {"type": "integer"},
+ "title": "Response Get Query List Query List Get",
+ }
+ }
+ },
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ },
+ },
+ }
+ },
+ "/query/list-default": {
+ "get": {
+ "summary": "Get Query List Default",
+ "operationId": "get_query_list_default_query_list_default_get",
+ "parameters": [
+ {
+ "name": "device_ids",
+ "in": "query",
+ "required": False,
+ "schema": {
+ "type": "array",
+ "items": {"type": "integer"},
+ "default": [],
+ "title": "Device Ids",
+ },
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {"type": "integer"},
+ "title": "Response Get Query List Default Query List Default Get",
+ }
+ }
+ },
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ },
+ },
+ }
+ },
},
"components": {
"schemas": {
diff --git a/tests/test_dependency_duplicates.py b/tests/test_dependency_duplicates.py
index 0882cc41d..8e8d07c2d 100644
--- a/tests/test_dependency_duplicates.py
+++ b/tests/test_dependency_duplicates.py
@@ -3,7 +3,6 @@ from typing import List
from dirty_equals import IsDict
from fastapi import Depends, FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel
app = FastAPI()
@@ -57,7 +56,6 @@ def test_no_duplicates_invalid():
"loc": ["body", "item2"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_dependency_overrides.py b/tests/test_dependency_overrides.py
index 21cff998d..154937fa0 100644
--- a/tests/test_dependency_overrides.py
+++ b/tests/test_dependency_overrides.py
@@ -4,7 +4,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import APIRouter, Depends, FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
app = FastAPI()
@@ -63,7 +62,6 @@ def test_main_depends():
"loc": ["query", "q"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -110,7 +108,6 @@ def test_decorator_depends():
"loc": ["query", "q"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -151,7 +148,6 @@ def test_router_depends():
"loc": ["query", "q"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -198,7 +194,6 @@ def test_router_decorator_depends():
"loc": ["query", "q"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -285,7 +280,6 @@ def test_override_with_sub_main_depends():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -316,7 +310,6 @@ def test_override_with_sub__main_depends_q_foo():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -355,7 +348,6 @@ def test_override_with_sub_decorator_depends():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -386,7 +378,6 @@ def test_override_with_sub_decorator_depends_q_foo():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -425,7 +416,6 @@ def test_override_with_sub_router_depends():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -456,7 +446,6 @@ def test_override_with_sub_router_depends_q_foo():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -495,7 +484,6 @@ def test_override_with_sub_router_decorator_depends():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -526,7 +514,6 @@ def test_override_with_sub_router_decorator_depends_q_foo():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_filter_pydantic_sub_model_pv2.py b/tests/test_filter_pydantic_sub_model_pv2.py
index 9097d2ce5..2e2c26ddc 100644
--- a/tests/test_filter_pydantic_sub_model_pv2.py
+++ b/tests/test_filter_pydantic_sub_model_pv2.py
@@ -5,7 +5,6 @@ from dirty_equals import HasRepr, IsDict, IsOneOf
from fastapi import Depends, FastAPI
from fastapi.exceptions import ResponseValidationError
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from .utils import needs_pydanticv2
@@ -67,7 +66,6 @@ def test_validator_is_cloned(client: TestClient):
"msg": "Value error, name must end in A",
"input": "modelX",
"ctx": {"error": HasRepr("ValueError('name must end in A')")},
- "url": match_pydantic_error_url("value_error"),
}
)
| IsDict(
diff --git a/tests/test_jsonable_encoder.py b/tests/test_jsonable_encoder.py
index 7c8338ff3..1906d6bf1 100644
--- a/tests/test_jsonable_encoder.py
+++ b/tests/test_jsonable_encoder.py
@@ -7,7 +7,7 @@ from pathlib import PurePath, PurePosixPath, PureWindowsPath
from typing import Optional
import pytest
-from fastapi._compat import PYDANTIC_V2
+from fastapi._compat import PYDANTIC_V2, Undefined
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel, Field, ValidationError
@@ -310,3 +310,9 @@ def test_encode_deque_encodes_child_models():
dq = deque([Model(test="test")])
assert jsonable_encoder(dq)[0]["test"] == "test"
+
+
+@needs_pydanticv2
+def test_encode_pydantic_undefined():
+ data = {"value": Undefined}
+ assert jsonable_encoder(data) == {"value": None}
diff --git a/tests/test_multi_body_errors.py b/tests/test_multi_body_errors.py
index a51ca7253..0102f0f1a 100644
--- a/tests/test_multi_body_errors.py
+++ b/tests/test_multi_body_errors.py
@@ -4,7 +4,6 @@ from typing import List
from dirty_equals import IsDict, IsOneOf
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel, condecimal
app = FastAPI()
@@ -52,7 +51,6 @@ def test_jsonable_encoder_requiring_error():
"msg": "Input should be greater than 0",
"input": -1.0,
"ctx": {"gt": 0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -82,28 +80,24 @@ def test_put_incorrect_body_multiple():
"loc": ["body", 0, "name"],
"msg": "Field required",
"input": {"age": "five"},
- "url": match_pydantic_error_url("missing"),
},
{
"type": "decimal_parsing",
"loc": ["body", 0, "age"],
"msg": "Input should be a valid decimal",
"input": "five",
- "url": match_pydantic_error_url("decimal_parsing"),
},
{
"type": "missing",
"loc": ["body", 1, "name"],
"msg": "Field required",
"input": {"age": "six"},
- "url": match_pydantic_error_url("missing"),
},
{
"type": "decimal_parsing",
"loc": ["body", 1, "age"],
"msg": "Input should be a valid decimal",
"input": "six",
- "url": match_pydantic_error_url("decimal_parsing"),
},
]
}
diff --git a/tests/test_multi_query_errors.py b/tests/test_multi_query_errors.py
index 470a35808..8162d986c 100644
--- a/tests/test_multi_query_errors.py
+++ b/tests/test_multi_query_errors.py
@@ -3,7 +3,6 @@ from typing import List
from dirty_equals import IsDict
from fastapi import FastAPI, Query
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
app = FastAPI()
@@ -33,14 +32,12 @@ def test_multi_query_incorrect():
"loc": ["query", "q", 0],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "five",
- "url": match_pydantic_error_url("int_parsing"),
},
{
"type": "int_parsing",
"loc": ["query", "q", 1],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "six",
- "url": match_pydantic_error_url("int_parsing"),
},
]
}
diff --git a/tests/test_path.py b/tests/test_path.py
index 848b245e2..09c1f13fb 100644
--- a/tests/test_path.py
+++ b/tests/test_path.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from .main import app
@@ -54,7 +53,6 @@ def test_path_int_foobar():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foobar",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -83,7 +81,6 @@ def test_path_int_True():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "True",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -118,7 +115,6 @@ def test_path_int_42_5():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "42.5",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -147,7 +143,6 @@ def test_path_float_foobar():
"loc": ["path", "item_id"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "foobar",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
@@ -176,7 +171,6 @@ def test_path_float_True():
"loc": ["path", "item_id"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "True",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
@@ -217,7 +211,6 @@ def test_path_bool_foobar():
"loc": ["path", "item_id"],
"msg": "Input should be a valid boolean, unable to interpret input",
"input": "foobar",
- "url": match_pydantic_error_url("bool_parsing"),
}
]
}
@@ -252,7 +245,6 @@ def test_path_bool_42():
"loc": ["path", "item_id"],
"msg": "Input should be a valid boolean, unable to interpret input",
"input": "42",
- "url": match_pydantic_error_url("bool_parsing"),
}
]
}
@@ -281,7 +273,6 @@ def test_path_bool_42_5():
"loc": ["path", "item_id"],
"msg": "Input should be a valid boolean, unable to interpret input",
"input": "42.5",
- "url": match_pydantic_error_url("bool_parsing"),
}
]
}
@@ -353,7 +344,6 @@ def test_path_param_minlength_fo():
"msg": "String should have at least 3 characters",
"input": "fo",
"ctx": {"min_length": 3},
- "url": match_pydantic_error_url("string_too_short"),
}
]
}
@@ -390,7 +380,6 @@ def test_path_param_maxlength_foobar():
"msg": "String should have at most 3 characters",
"input": "foobar",
"ctx": {"max_length": 3},
- "url": match_pydantic_error_url("string_too_long"),
}
]
}
@@ -427,7 +416,6 @@ def test_path_param_min_maxlength_foobar():
"msg": "String should have at most 3 characters",
"input": "foobar",
"ctx": {"max_length": 3},
- "url": match_pydantic_error_url("string_too_long"),
}
]
}
@@ -458,7 +446,6 @@ def test_path_param_min_maxlength_f():
"msg": "String should have at least 2 characters",
"input": "f",
"ctx": {"min_length": 2},
- "url": match_pydantic_error_url("string_too_short"),
}
]
}
@@ -494,7 +481,6 @@ def test_path_param_gt_2():
"msg": "Input should be greater than 3",
"input": "2",
"ctx": {"gt": 3.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -531,7 +517,6 @@ def test_path_param_gt0_0():
"msg": "Input should be greater than 0",
"input": "0",
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -574,7 +559,6 @@ def test_path_param_ge_2():
"msg": "Input should be greater than or equal to 3",
"input": "2",
"ctx": {"ge": 3.0},
- "url": match_pydantic_error_url("greater_than_equal"),
}
]
}
@@ -605,7 +589,6 @@ def test_path_param_lt_42():
"msg": "Input should be less than 3",
"input": "42",
"ctx": {"lt": 3.0},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -648,7 +631,6 @@ def test_path_param_lt0_0():
"msg": "Input should be less than 0",
"input": "0",
"ctx": {"lt": 0.0},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -679,7 +661,6 @@ def test_path_param_le_42():
"msg": "Input should be less than or equal to 3",
"input": "42",
"ctx": {"le": 3.0},
- "url": match_pydantic_error_url("less_than_equal"),
}
]
}
@@ -728,7 +709,6 @@ def test_path_param_lt_gt_4():
"msg": "Input should be less than 3",
"input": "4",
"ctx": {"lt": 3.0},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -759,7 +739,6 @@ def test_path_param_lt_gt_0():
"msg": "Input should be greater than 1",
"input": "0",
"ctx": {"gt": 1.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -807,7 +786,6 @@ def test_path_param_le_ge_4():
"msg": "Input should be less than or equal to 3",
"input": "4",
"ctx": {"le": 3.0},
- "url": match_pydantic_error_url("less_than_equal"),
}
]
}
@@ -844,7 +822,6 @@ def test_path_param_lt_int_42():
"msg": "Input should be less than 3",
"input": "42",
"ctx": {"lt": 3},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -874,7 +851,6 @@ def test_path_param_lt_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -910,7 +886,6 @@ def test_path_param_gt_int_2():
"msg": "Input should be greater than 3",
"input": "2",
"ctx": {"gt": 3},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -940,7 +915,6 @@ def test_path_param_gt_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -970,7 +944,6 @@ def test_path_param_le_int_42():
"msg": "Input should be less than or equal to 3",
"input": "42",
"ctx": {"le": 3},
- "url": match_pydantic_error_url("less_than_equal"),
}
]
}
@@ -1012,7 +985,6 @@ def test_path_param_le_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -1054,7 +1026,6 @@ def test_path_param_ge_int_2():
"msg": "Input should be greater than or equal to 3",
"input": "2",
"ctx": {"ge": 3},
- "url": match_pydantic_error_url("greater_than_equal"),
}
]
}
@@ -1084,7 +1055,6 @@ def test_path_param_ge_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -1120,7 +1090,6 @@ def test_path_param_lt_gt_int_4():
"msg": "Input should be less than 3",
"input": "4",
"ctx": {"lt": 3},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -1151,7 +1120,6 @@ def test_path_param_lt_gt_int_0():
"msg": "Input should be greater than 1",
"input": "0",
"ctx": {"gt": 1},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -1181,7 +1149,6 @@ def test_path_param_lt_gt_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -1229,7 +1196,6 @@ def test_path_param_le_ge_int_4():
"msg": "Input should be less than or equal to 3",
"input": "4",
"ctx": {"le": 3},
- "url": match_pydantic_error_url("less_than_equal"),
}
]
}
@@ -1259,7 +1225,6 @@ def test_path_param_le_ge_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_query.py b/tests/test_query.py
index 5bb9995d6..57f551d2a 100644
--- a/tests/test_query.py
+++ b/tests/test_query.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from .main import app
@@ -18,7 +17,6 @@ def test_query():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -53,7 +51,6 @@ def test_query_not_declared_baz():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -100,7 +97,6 @@ def test_query_int():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -135,7 +131,6 @@ def test_query_int_query_42_5():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "42.5",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -164,7 +159,6 @@ def test_query_int_query_baz():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "baz",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -193,7 +187,6 @@ def test_query_int_not_declared_baz():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -234,7 +227,6 @@ def test_query_int_optional_query_foo():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -275,7 +267,6 @@ def test_query_int_default_query_foo():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -316,7 +307,6 @@ def test_query_param_required():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -351,7 +341,6 @@ def test_query_param_required_int():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -386,7 +375,6 @@ def test_query_param_required_int_query_foo():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -408,3 +396,26 @@ def test_query_frozenset_query_1_query_1_query_2():
response = client.get("/query/frozenset/?query=1&query=1&query=2")
assert response.status_code == 200
assert response.json() == "1,2"
+
+
+def test_query_list():
+ response = client.get("/query/list/?device_ids=1&device_ids=2")
+ assert response.status_code == 200
+ assert response.json() == [1, 2]
+
+
+def test_query_list_empty():
+ response = client.get("/query/list/")
+ assert response.status_code == 422
+
+
+def test_query_list_default():
+ response = client.get("/query/list-default/?device_ids=1&device_ids=2")
+ assert response.status_code == 200
+ assert response.json() == [1, 2]
+
+
+def test_query_list_default_empty():
+ response = client.get("/query/list-default/")
+ assert response.status_code == 200
+ assert response.json() == []
diff --git a/tests/test_regex_deprecated_body.py b/tests/test_regex_deprecated_body.py
index 7afddd9ae..74654ff3c 100644
--- a/tests/test_regex_deprecated_body.py
+++ b/tests/test_regex_deprecated_body.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI, Form
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from typing_extensions import Annotated
from .utils import needs_py310
@@ -55,7 +54,6 @@ def test_query_nonregexquery():
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_regex_deprecated_params.py b/tests/test_regex_deprecated_params.py
index 7190b543c..2ce64c686 100644
--- a/tests/test_regex_deprecated_params.py
+++ b/tests/test_regex_deprecated_params.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI, Query
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from typing_extensions import Annotated
from .utils import needs_py310
@@ -55,7 +54,6 @@ def test_query_params_str_validations_item_query_nonregexquery():
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_security_oauth2.py b/tests/test_security_oauth2.py
index e98f80ebf..7d914d034 100644
--- a/tests/test_security_oauth2.py
+++ b/tests/test_security_oauth2.py
@@ -2,7 +2,6 @@ from dirty_equals import IsDict
from fastapi import Depends, FastAPI, Security
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel
app = FastAPI()
@@ -71,21 +70,18 @@ def test_strict_login_no_data():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -124,7 +120,6 @@ def test_strict_login_no_grant_type():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -157,7 +152,6 @@ def test_strict_login_incorrect_grant_type():
"msg": "String should match pattern 'password'",
"input": "incorrect",
"ctx": {"pattern": "password"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_security_oauth2_optional.py b/tests/test_security_oauth2_optional.py
index d06c01bba..0da3b911e 100644
--- a/tests/test_security_oauth2_optional.py
+++ b/tests/test_security_oauth2_optional.py
@@ -4,7 +4,6 @@ from dirty_equals import IsDict
from fastapi import Depends, FastAPI, Security
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel
app = FastAPI()
@@ -75,21 +74,18 @@ def test_strict_login_no_data():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -128,7 +124,6 @@ def test_strict_login_no_grant_type():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -161,7 +156,6 @@ def test_strict_login_incorrect_grant_type():
"msg": "String should match pattern 'password'",
"input": "incorrect",
"ctx": {"pattern": "password"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_security_oauth2_optional_description.py b/tests/test_security_oauth2_optional_description.py
index 9287e4366..85a9f9b39 100644
--- a/tests/test_security_oauth2_optional_description.py
+++ b/tests/test_security_oauth2_optional_description.py
@@ -4,7 +4,6 @@ from dirty_equals import IsDict
from fastapi import Depends, FastAPI, Security
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel
app = FastAPI()
@@ -76,21 +75,18 @@ def test_strict_login_None():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -129,7 +125,6 @@ def test_strict_login_no_grant_type():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -162,7 +157,6 @@ def test_strict_login_incorrect_grant_type():
"msg": "String should match pattern 'password'",
"input": "incorrect",
"ctx": {"pattern": "password"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_bigger_applications/test_main.py b/tests/test_tutorial/test_bigger_applications/test_main.py
index 526e265a6..35fdfa4a6 100644
--- a/tests/test_tutorial/test_bigger_applications/test_main.py
+++ b/tests/test_tutorial/test_bigger_applications/test_main.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_users_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -64,7 +62,6 @@ def test_users_foo_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -99,7 +96,6 @@ def test_users_me_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -145,7 +141,6 @@ def test_items_with_no_token_jessica(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -192,7 +187,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -233,7 +227,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -262,7 +255,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -297,7 +289,6 @@ def test_root_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -326,14 +317,12 @@ def test_put_no_header(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_bigger_applications/test_main_an.py b/tests/test_tutorial/test_bigger_applications/test_main_an.py
index c0b77d4a7..4e2e3e74d 100644
--- a/tests/test_tutorial/test_bigger_applications/test_main_an.py
+++ b/tests/test_tutorial/test_bigger_applications/test_main_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_users_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -64,7 +62,6 @@ def test_users_foo_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -99,7 +96,6 @@ def test_users_me_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -145,7 +141,6 @@ def test_items_with_no_token_jessica(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -192,7 +187,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -233,7 +227,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -262,7 +255,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -297,7 +289,6 @@ def test_root_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -326,14 +317,12 @@ def test_put_no_header(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_bigger_applications/test_main_an_py39.py b/tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
index 948331b5d..8c9e976df 100644
--- a/tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
+++ b/tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -33,7 +32,6 @@ def test_users_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -70,7 +68,6 @@ def test_users_foo_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -107,7 +104,6 @@ def test_users_me_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -156,7 +152,6 @@ def test_items_with_no_token_jessica(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -206,7 +201,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -250,7 +244,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -280,7 +273,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -317,7 +309,6 @@ def test_root_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -347,14 +338,12 @@ def test_put_no_header(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body/test_tutorial001.py b/tests/test_tutorial/test_body/test_tutorial001.py
index 2476b773f..0d55d73eb 100644
--- a/tests/test_tutorial/test_body/test_tutorial001.py
+++ b/tests/test_tutorial/test_body/test_tutorial001.py
@@ -3,7 +3,6 @@ from unittest.mock import patch
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture
@@ -74,7 +73,6 @@ def test_post_with_only_name(client: TestClient):
"loc": ["body", "price"],
"msg": "Field required",
"input": {"name": "Foo"},
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -103,7 +101,6 @@ def test_post_with_only_name_price(client: TestClient):
"loc": ["body", "price"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "twenty",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
@@ -132,14 +129,12 @@ def test_post_with_no_data(client: TestClient):
"loc": ["body", "name"],
"msg": "Field required",
"input": {},
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "price"],
"msg": "Field required",
"input": {},
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -173,7 +168,6 @@ def test_post_with_none(client: TestClient):
"loc": ["body"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -244,7 +238,6 @@ def test_post_form_for_json(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": "name=Foo&price=50.5",
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -308,9 +301,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url(
- "model_attributes_type"
- ), # "https://errors.pydantic.dev/0.38.0/v/dict_attributes_type",
}
]
}
@@ -339,7 +329,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -367,7 +356,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
diff --git a/tests/test_tutorial/test_body/test_tutorial001_py310.py b/tests/test_tutorial/test_body/test_tutorial001_py310.py
index b64d86005..4b9c12806 100644
--- a/tests/test_tutorial/test_body/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_body/test_tutorial001_py310.py
@@ -3,7 +3,6 @@ from unittest.mock import patch
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -81,7 +80,6 @@ def test_post_with_only_name(client: TestClient):
"loc": ["body", "price"],
"msg": "Field required",
"input": {"name": "Foo"},
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -111,7 +109,6 @@ def test_post_with_only_name_price(client: TestClient):
"loc": ["body", "price"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "twenty",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
@@ -141,14 +138,12 @@ def test_post_with_no_data(client: TestClient):
"loc": ["body", "name"],
"msg": "Field required",
"input": {},
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "price"],
"msg": "Field required",
"input": {},
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -183,7 +178,6 @@ def test_post_with_none(client: TestClient):
"loc": ["body"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -256,7 +250,6 @@ def test_post_form_for_json(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": "name=Foo&price=50.5",
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -324,7 +317,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -353,7 +345,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -381,7 +372,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001.py b/tests/test_tutorial/test_body_fields/test_tutorial001.py
index 1ff2d9576..fd6139eb9 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -57,7 +56,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001_an.py b/tests/test_tutorial/test_body_fields/test_tutorial001_an.py
index 907d6842a..72c18c1f7 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -57,7 +56,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py b/tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py
index 431d2d181..1bc62868f 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py b/tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py
index 8cef6c154..3c5557a1b 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001_py310.py b/tests/test_tutorial/test_body_fields/test_tutorial001_py310.py
index b48cd9ec2..8c1386aa6 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
index e5dc13b26..6275ebe95 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -50,7 +49,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
index 51e8e3a4e..5cd3e2c4a 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -50,7 +49,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py
index 8ac1f7261..0173ab21b 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py
index 7ada42c52..cda19918a 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py
index 0a832eaf6..663291933 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
index 2046579a9..c26f8b89b 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -46,21 +45,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -99,21 +95,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py
index 1282483e0..62c7e2fad 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -46,21 +45,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -99,21 +95,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py
index 577c079d0..f46430fb5 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py
index 0ec04151c..29071cddc 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py
index 9caf5fe6c..133afe9b5 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial009.py b/tests/test_tutorial/test_body_nested_models/test_tutorial009.py
index f4a76be44..762073aea 100644
--- a/tests/test_tutorial/test_body_nested_models/test_tutorial009.py
+++ b/tests/test_tutorial/test_body_nested_models/test_tutorial009.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -31,7 +30,6 @@ def test_post_invalid_body(client: TestClient):
"loc": ["body", "foo", "[key]"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py b/tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py
index 8ab9bcac8..24623cecc 100644
--- a/tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py
+++ b/tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -35,7 +34,6 @@ def test_post_invalid_body(client: TestClient):
"loc": ["body", "foo", "[key]"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py b/tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
index ad142ec88..6f7355aaa 100644
--- a/tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
+++ b/tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.custom_request_and_route.tutorial002 import app
@@ -23,7 +22,6 @@ def test_exception_handler_body_access():
"loc": ["body"],
"msg": "Input should be a valid list",
"input": {"numbers": [1, 2, 3]},
- "url": match_pydantic_error_url("list_type"),
}
],
"body": '{"numbers": [1, 2, 3]}',
diff --git a/tests/test_tutorial/test_dataclasses/test_tutorial001.py b/tests/test_tutorial/test_dataclasses/test_tutorial001.py
index 9f1200f37..762654d29 100644
--- a/tests/test_tutorial/test_dataclasses/test_tutorial001.py
+++ b/tests/test_tutorial/test_dataclasses/test_tutorial001.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dataclasses.tutorial001 import app
@@ -29,7 +28,6 @@ def test_post_invalid_item():
"loc": ["body", "price"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "invalid price",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial006.py b/tests/test_tutorial/test_dependencies/test_tutorial006.py
index 704e389a5..5f14d9a3b 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial006.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial006.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dependencies.tutorial006 import app
@@ -18,14 +17,12 @@ def test_get_no_headers():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial006_an.py b/tests/test_tutorial/test_dependencies/test_tutorial006_an.py
index 5034fceba..a307ff808 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial006_an.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial006_an.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dependencies.tutorial006_an import app
@@ -18,14 +17,12 @@ def test_get_no_headers():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py
index 3fc22dd3c..b41b1537e 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -26,14 +25,12 @@ def test_get_no_headers(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial012.py b/tests/test_tutorial/test_dependencies/test_tutorial012.py
index 753e62e43..6b53c83bb 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial012.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial012.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dependencies.tutorial012 import app
@@ -18,14 +17,12 @@ def test_get_no_headers_items():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -59,14 +56,12 @@ def test_get_no_headers_users():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial012_an.py b/tests/test_tutorial/test_dependencies/test_tutorial012_an.py
index 4157d4612..75adb69fc 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial012_an.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial012_an.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dependencies.tutorial012_an import app
@@ -18,14 +17,12 @@ def test_get_no_headers_items():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -59,14 +56,12 @@ def test_get_no_headers_users():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py
index 9e46758cb..e0a3d1ec2 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -26,14 +25,12 @@ def test_get_no_headers_items(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -68,14 +65,12 @@ def test_get_no_headers_users(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001.py
index 7710446ce..5558671b9 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001.py
@@ -67,6 +67,7 @@ def test_openapi_schema():
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -86,7 +87,7 @@ def test_openapi_schema():
}
)
}
- }
+ },
},
}
}
@@ -97,40 +98,16 @@ def test_openapi_schema():
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -151,10 +128,8 @@ def test_openapi_schema():
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -166,6 +141,7 @@ def test_openapi_schema():
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py
index 9951b3b51..e309f8bd6 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py
@@ -67,6 +67,7 @@ def test_openapi_schema():
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -86,7 +87,7 @@ def test_openapi_schema():
}
)
}
- }
+ },
},
}
}
@@ -97,40 +98,16 @@ def test_openapi_schema():
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -151,10 +128,8 @@ def test_openapi_schema():
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -166,6 +141,7 @@ def test_openapi_schema():
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py
index 7c482b8cb..ca110dc00 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
}
)
}
- }
+ },
},
}
}
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py
index 87473867b..3386fb1fd 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
}
)
}
- }
+ },
},
}
}
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py
index 0b71d9177..50c9aefdf 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
}
)
}
- }
+ },
},
}
}
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_handling_errors/test_tutorial005.py b/tests/test_tutorial/test_handling_errors/test_tutorial005.py
index 494c317ca..581b2e4c7 100644
--- a/tests/test_tutorial/test_handling_errors/test_tutorial005.py
+++ b/tests/test_tutorial/test_handling_errors/test_tutorial005.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.handling_errors.tutorial005 import app
@@ -18,7 +17,6 @@ def test_post_validation_error():
"loc": ["body", "size"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "XL",
- "url": match_pydantic_error_url("int_parsing"),
}
],
"body": {"title": "towel", "size": "XL"},
diff --git a/tests/test_tutorial/test_handling_errors/test_tutorial006.py b/tests/test_tutorial/test_handling_errors/test_tutorial006.py
index cc2b496a8..7d2f553aa 100644
--- a/tests/test_tutorial/test_handling_errors/test_tutorial006.py
+++ b/tests/test_tutorial/test_handling_errors/test_tutorial006.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.handling_errors.tutorial006 import app
@@ -18,7 +17,6 @@ def test_get_validation_error():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py b/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
index 2d2802269..8240b60a6 100644
--- a/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
+++ b/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
@@ -1,6 +1,5 @@
import pytest
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_pydanticv2
@@ -64,7 +63,6 @@ def test_post_invalid(client: TestClient):
"loc": ["tags", 3],
"msg": "Input should be a valid string",
"input": {"sneaky": "object"},
- "url": match_pydantic_error_url("string_type"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params/test_tutorial005.py b/tests/test_tutorial/test_query_params/test_tutorial005.py
index 921586357..05ae85b45 100644
--- a/tests/test_tutorial/test_query_params/test_tutorial005.py
+++ b/tests/test_tutorial/test_query_params/test_tutorial005.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.query_params.tutorial005 import app
@@ -24,7 +23,6 @@ def test_foo_no_needy():
"loc": ["query", "needy"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params/test_tutorial006.py b/tests/test_tutorial/test_query_params/test_tutorial006.py
index e07803d6c..dbd63da16 100644
--- a/tests/test_tutorial/test_query_params/test_tutorial006.py
+++ b/tests/test_tutorial/test_query_params/test_tutorial006.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -34,21 +33,18 @@ def test_foo_no_needy(client: TestClient):
"loc": ["query", "needy"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "int_parsing",
"loc": ["query", "skip"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "a",
- "url": match_pydantic_error_url("int_parsing"),
},
{
"type": "int_parsing",
"loc": ["query", "limit"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "b",
- "url": match_pydantic_error_url("int_parsing"),
},
]
}
diff --git a/tests/test_tutorial/test_query_params/test_tutorial006_py310.py b/tests/test_tutorial/test_query_params/test_tutorial006_py310.py
index 6c4c0b4dc..5055e3805 100644
--- a/tests/test_tutorial/test_query_params/test_tutorial006_py310.py
+++ b/tests/test_tutorial/test_query_params/test_tutorial006_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -38,21 +37,18 @@ def test_foo_no_needy(client: TestClient):
"loc": ["query", "needy"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "int_parsing",
"loc": ["query", "skip"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "a",
- "url": match_pydantic_error_url("int_parsing"),
},
{
"type": "int_parsing",
"loc": ["query", "limit"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "b",
- "url": match_pydantic_error_url("int_parsing"),
},
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py
index 287c2e8f8..945cee3d2 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -45,7 +44,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py
index 5b0515070..23951a9aa 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -45,7 +44,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py
index d22b1ce20..2968af563 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py
index 3e7d5d3ad..534ba8759 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py
index 1c3a09d39..886bceca2 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial001.py b/tests/test_tutorial/test_request_files/test_tutorial001.py
index 91cc2b636..f5817593b 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial001.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial001.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.request_files.tutorial001 import app
@@ -29,7 +28,6 @@ def test_post_form_no_body():
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -58,7 +56,6 @@ def test_post_body_json():
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial001_an.py b/tests/test_tutorial/test_request_files/test_tutorial001_an.py
index 3021eb3c3..1c78e3679 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial001_an.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.request_files.tutorial001_an import app
@@ -18,7 +17,6 @@ def test_post_form_no_body():
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -47,7 +45,6 @@ def test_post_body_json():
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py b/tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
index 04f3a4693..843fcec28 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -26,7 +25,6 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -56,7 +54,6 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial002.py b/tests/test_tutorial/test_request_files/test_tutorial002.py
index ed9680b62..db1552e5c 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial002.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial002.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.request_files.tutorial002 import app
@@ -18,7 +17,6 @@ def test_post_form_no_body():
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -47,7 +45,6 @@ def test_post_body_json():
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial002_an.py b/tests/test_tutorial/test_request_files/test_tutorial002_an.py
index ea8c1216c..b16da1669 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial002_an.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial002_an.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.request_files.tutorial002_an import app
@@ -18,7 +17,6 @@ def test_post_form_no_body():
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -47,7 +45,6 @@ def test_post_body_json():
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py b/tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py
index 6d5877836..e092a516d 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -32,7 +31,6 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -62,7 +60,6 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial002_py39.py b/tests/test_tutorial/test_request_files/test_tutorial002_py39.py
index 2d0445421..341a9ac8e 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial002_py39.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial002_py39.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -43,7 +42,6 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -73,7 +71,6 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_forms/test_tutorial001.py b/tests/test_tutorial/test_request_forms/test_tutorial001.py
index 805daeb10..cbef9d30f 100644
--- a/tests/test_tutorial/test_request_forms/test_tutorial001.py
+++ b/tests/test_tutorial/test_request_forms/test_tutorial001.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_post_body_form_no_password(client: TestClient):
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -58,7 +56,6 @@ def test_post_body_form_no_username(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -87,14 +84,12 @@ def test_post_body_form_no_data(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -128,14 +123,12 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms/test_tutorial001_an.py b/tests/test_tutorial/test_request_forms/test_tutorial001_an.py
index c43a0b695..88b8452bc 100644
--- a/tests/test_tutorial/test_request_forms/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_request_forms/test_tutorial001_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_post_body_form_no_password(client: TestClient):
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -58,7 +56,6 @@ def test_post_body_form_no_username(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -87,14 +84,12 @@ def test_post_body_form_no_data(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -128,14 +123,12 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py b/tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
index 078b812aa..3229897c9 100644
--- a/tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -33,7 +32,6 @@ def test_post_body_form_no_password(client: TestClient):
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -63,7 +61,6 @@ def test_post_body_form_no_username(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -93,14 +90,12 @@ def test_post_body_form_no_data(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -135,14 +130,12 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
index cac58639f..1e1ad2a87 100644
--- a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
+++ b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="app")
@@ -29,21 +28,18 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -82,14 +78,12 @@ def test_post_form_no_file(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -123,21 +117,18 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -181,14 +172,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py
index 009568048..5daf4dbf4 100644
--- a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="app")
@@ -29,21 +28,18 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -82,14 +78,12 @@ def test_post_form_no_file(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -123,21 +117,18 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -181,14 +172,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py
index 3d007e90b..3f1204efa 100644
--- a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -32,21 +31,18 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -86,14 +82,12 @@ def test_post_form_no_file(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -128,21 +122,18 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -187,14 +178,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}