Search Options

Results per page
Sort
Preferred Languages
Advance

Results 191 - 200 of 849 for Pydantic (0.06 sec)

  1. tests/test_tutorial/test_schema_extra_example/test_tutorial005_an.py

                                    "schema": IsDict({"$ref": "#/components/schemas/Item"})
                                    | IsDict(
                                        # TODO: remove when deprecating Pydantic v1
                                        {
                                            "allOf": [
                                                {"$ref": "#/components/schemas/Item"}
                                            ],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_schema_extra_example/test_tutorial005_py310.py

                                    "schema": IsDict({"$ref": "#/components/schemas/Item"})
                                    | IsDict(
                                        # TODO: remove when deprecating Pydantic v1
                                        {
                                            "allOf": [
                                                {"$ref": "#/components/schemas/Item"}
                                            ],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  3. docs/ru/docs/tutorial/body-nested-models.md

    Чтобы увидеть все варианты, которые у вас есть, ознакомьтесь с документацией <a href="https://docs.pydantic.dev/latest/concepts/types/" class="external-link" target="_blank">по необычным типам Pydantic</a>. Вы увидите некоторые примеры в следующей главе.
    
    Например, так как в модели `Image` у нас есть поле `url`, то мы можем объявить его как тип `HttpUrl` из модуля Pydantic вместо типа `str`:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="2  8"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 14.8K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/schema-extra-example.md

    # 模式的额外信息 - 例子
    
    您可以在JSON模式中定义额外的信息。
    
    一个常见的用例是添加一个将在文档中显示的`example`。
    
    有几种方法可以声明额外的 JSON 模式信息。
    
    ## Pydantic `schema_extra`
    
    您可以使用 `Config` 和 `schema_extra` 为Pydantic模型声明一个示例,如<a href="https://docs.pydantic.dev/latest/concepts/json_schema/#schema-customization" class="external-link" target="_blank">Pydantic 文档:定制 Schema </a>中所述:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="13-21"
    {!> ../../docs_src/schema_extra_example/tutorial001_py310.py!}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py

                        "msg": "Field required",
                        "input": None,
                    },
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["body", "file"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  6. docs/pt/docs/python-types.md

    /// info | Informação
    
    Para saber mais sobre o <a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic, verifique a sua documentação</a>.
    
    ///
    
    O **FastAPI** é todo baseado em Pydantic.
    
    Você verá muito mais disso na prática no [Tutorial - Guia do usuário](tutorial/index.md){.internal-link target=_blank}.
    
    /// tip | Dica
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 15 12:32:27 UTC 2024
    - 18K bytes
    - Viewed (0)
  7. docs/zh/docs/advanced/additional-responses.md

    ## `model`附加响应
    您可以向路径操作装饰器传递参数 `responses` 。
    
    它接收一个 `dict`,键是每个响应的状态代码(如`200`),值是包含每个响应信息的其他 `dict`。
    
    每个响应字典都可以有一个关键模型,其中包含一个 `Pydantic` 模型,就像 `response_model` 一样。
    
    **FastAPI**将采用该模型,生成其`JSON Schema`并将其包含在`OpenAPI`中的正确位置。
    
    例如,要声明另一个具有状态码 `404` 和`Pydantic`模型 `Message` 的响应,可以写:
    ```Python hl_lines="18  22"
    {!../../docs_src/additional_responses/tutorial001.py!}
    ```
    
    /// note
    
    请记住,您必须直接返回 `JSONResponse` 。
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  8. tests/test_union_body.py

    from typing import Optional, Union
    
    from dirty_equals import IsDict
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: Optional[str] = None
    
    
    class OtherItem(BaseModel):
        price: int
    
    
    @app.post("/items/")
    def save_union_body(item: Union[OtherItem, Item]):
        return {"item": item}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  9. docs/em/docs/tutorial/body-fields.md

    # 💪 - 🏑
    
    🎏 🌌 👆 💪 📣 🌖 🔬 &amp; 🗃 *➡ 🛠️ 🔢* 🔢 ⏮️ `Query`, `Path` &amp; `Body`, 👆 💪 📣 🔬 &amp; 🗃 🔘 Pydantic 🏷 ⚙️ Pydantic `Field`.
    
    ## 🗄 `Field`
    
    🥇, 👆 ✔️ 🗄 ⚫️:
    
    //// tab | 🐍 3️⃣.6️⃣ &amp; 🔛
    
    ```Python hl_lines="4"
    {!> ../../docs_src/body_fields/tutorial001.py!}
    ```
    
    ////
    
    //// tab | 🐍 3️⃣.1️⃣0️⃣ &amp; 🔛
    
    ```Python hl_lines="2"
    {!> ../../docs_src/body_fields/tutorial001_py310.py!}
    ```
    
    ////
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_schema_extra_example/test_tutorial005_an_py39.py

                                    "schema": IsDict({"$ref": "#/components/schemas/Item"})
                                    | IsDict(
                                        # TODO: remove when deprecating Pydantic v1
                                        {
                                            "allOf": [
                                                {"$ref": "#/components/schemas/Item"}
                                            ],
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 6.8K bytes
    - Viewed (0)
Back to top