- Sort Score
- Num 10 results
- Language All
Results 31 - 40 of 844 for pydantic (0.05 seconds)
-
docs/zh-hant/docs/tutorial/cookie-param-models.md
# Cookie 參數模型 { #cookie-parameter-models } 如果你有一組彼此相關的「**Cookie**」,你可以建立一個「**Pydantic 模型**」來宣告它們。🍪 這樣你就能在**多處**重複使用該模型,並且能一次性為所有參數宣告**驗證**與**中繼資料**。😎 /// note | 注意 自 FastAPI 版本 `0.115.0` 起支援。🤓 /// /// tip 同樣的技巧也適用於 `Query`、`Cookie` 與 `Header`。😎 /// ## 以 Pydantic 模型宣告 Cookie { #cookies-with-a-pydantic-model } 在 **Pydantic 模型**中宣告所需的 **Cookie** 參數,接著將參數宣告為 `Cookie`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 2.9K bytes - Click Count (0) -
fastapi/.agents/skills/fastapi/SKILL.md
## Do not use Pydantic RootModels Do not use Pydantic `RootModel`, instead use regular type annotations with `Annotated` and Pydantic validation utilities. For example, for a list with validations you could do: ```python from typing import Annotated from fastapi import Body, FastAPI from pydantic import Field app = FastAPI() @app.post("/items/")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 01 10:05:57 GMT 2026 - 10.1K bytes - Click Count (0) -
docs/en/docs/features.md
* **Session and Cookie** support. * 100% test coverage. * 100% type annotated codebase. ## Pydantic features { #pydantic-features } **FastAPI** is fully compatible with (and based on) [**Pydantic**](https://docs.pydantic.dev/). So, any additional Pydantic code you have, will also work.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 8.9K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/body-fields.md
# Body - 欄位 { #body-fields } 就像你可以在「路徑操作函式 (path operation function)」的參數中用 `Query`、`Path` 和 `Body` 宣告額外的驗證與中繼資料一樣,你也可以在 Pydantic 模型中使用 Pydantic 的 `Field` 來宣告驗證與中繼資料。 ## 匯入 `Field` { #import-field } 首先,你需要匯入它: {* ../../docs_src/body_fields/tutorial001_an_py310.py hl[4] *} /// warning 請注意,`Field` 是直接從 `pydantic` 匯入的,不像其他(如 `Query`、`Path`、`Body` 等)是從 `fastapi` 匯入。 /// ## 宣告模型屬性 { #declare-model-attributes }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 2.3K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/extra-models.md
### 關於 `**user_in.model_dump()` { #about-user-in-model-dump } #### Pydantic 的 `.model_dump()` { #pydantics-model-dump } `user_in` 是一個 `UserIn` 類別的 Pydantic 模型。 Pydantic 模型有 `.model_dump()` 方法,會回傳包含該模型資料的 `dict`。 因此,若我們建立一個 Pydantic 物件 `user_in` 如: ```Python user_in = UserIn(username="john", password="secret", email="******@****.***") ``` 接著呼叫:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 6.3K bytes - Click Count (0) -
docs/en/docs/tutorial/query-param-models.md
This would allow you to **re-use the model** in **multiple places** and also to declare validations and metadata for all the parameters at once. 😎 /// note This is supported since FastAPI version `0.115.0`. 🤓 /// ## Query Parameters with a Pydantic Model { #query-parameters-with-a-pydantic-model }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Aug 31 09:15:41 GMT 2025 - 2.2K bytes - Click Count (0) -
docs/en/docs/tutorial/schema-extra-example.md
/// ### Pydantic and FastAPI `examples` { #pydantic-and-fastapi-examples } When you add `examples` inside a Pydantic model, using `schema_extra` or `Field(examples=["something"])` that example is added to the **JSON Schema** for that Pydantic model. And that **JSON Schema** of the Pydantic model is included in the **OpenAPI** of your API, and then it's used in the docs UI.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 8.7K bytes - Click Count (0) -
docs/ja/docs/features.md
* **CORS**、GZip、静的ファイル、ストリーミングレスポンス。 * **セッションと Cookie** のサポート。 * テストカバレッジ 100%。 * 型アノテーション 100% のコードベース。 ## Pydanticの機能 { #pydantic-features } **FastAPI** は [**Pydantic**](https://docs.pydantic.dev/) と完全に互換性があり(かつそれに基づいています)。そのため、手元の Pydantic の追加コードも動作します。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 11.6K bytes - Click Count (0) -
docs/ko/docs/tutorial/encoder.md
같은 방식으로 이 데이터베이스는 Pydantic 모델(속성이 있는 객체)을 받지 않고, `dict`만을 받습니다. 이를 위해 `jsonable_encoder`를 사용할 수 있습니다. Pydantic 모델 같은 객체를 받고 JSON 호환 가능한 버전을 반환합니다: {* ../../docs_src/encoder/tutorial001_py310.py hl[4,21] *} 이 예시에서는 Pydantic 모델을 `dict`로, `datetime`을 `str`로 변환합니다. 이렇게 호출한 결과는 파이썬 표준인 [`json.dumps()`](https://docs.python.org/3/library/json.html#json.dumps)로 인코딩할 수 있습니다.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 1.8K bytes - Click Count (0) -
docs/en/docs/tutorial/encoder.md
The same way, this database wouldn't receive a Pydantic model (an object with attributes), only a `dict`. You can use `jsonable_encoder` for that. It receives an object, like a Pydantic model, and returns a JSON compatible version: {* ../../docs_src/encoder/tutorial001_py310.py hl[4,21] *} In this example, it would convert the Pydantic model to a `dict`, and the `datetime` to a `str`.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 1.6K bytes - Click Count (0)