Search Options

Results per page
Sort
Preferred Languages
Advance

Results 221 - 230 of 849 for Pydantic (0.09 sec)

  1. docs/zh/docs/features.md

    * 测试客户端基于 HTTPX。
    * **CORS**, GZip, 静态文件, 流响应。
    * 支持 **Session 和 Cookie** 。
    * 100% 测试覆盖率。
    * 代码库 100% 类型注释。
    
    ## Pydantic 特性
    
    **FastAPI** 和 <a href="https://docs.pydantic.dev/" class="external-link" target="_blank"><strong>Pydantic</strong></a> 完全兼容(并基于)。所以,你有的其他的 Pydantic 代码也能正常工作。
    
    兼容包括基于 Pydantic 的外部库, 例如用与数据库的 <abbr title="对象关系映射">ORM</abbr>s, <abbr title="对象文档映射">ODM</abbr>s。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  2. tests/test_sub_callbacks.py

    from typing import Optional
    
    from dirty_equals import IsDict
    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, HttpUrl
    
    app = FastAPI()
    
    
    class Invoice(BaseModel):
        id: str
        title: Optional[str] = None
        customer: str
        total: float
    
    
    class InvoiceEvent(BaseModel):
        description: str
        paid: bool
    
    
    class InvoiceEventReceived(BaseModel):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 13.8K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/body-nested-models.md

    * 自动生成文档
    
    ## 特殊的类型和校验
    
    除了普通的单一值类型(如 `str`、`int`、`float` 等)外,你还可以使用从 `str` 继承的更复杂的单一值类型。
    
    要了解所有的可用选项,请查看关于 <a href="https://docs.pydantic.dev/latest/concepts/types/" class="external-link" target="_blank">来自 Pydantic 的外部类型</a> 的文档。你将在下一章节中看到一些示例。
    
    例如,在 `Image` 模型中我们有一个 `url` 字段,我们可以把它声明为 Pydantic 的 `HttpUrl`,而不是 `str`:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="2  8"
    {!> ../../docs_src/body_nested_models/tutorial005_py310.py!}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/body-nested-models.md

    And it will be annotated / documented accordingly too.
    
    ## Nested Models
    
    Each attribute of a Pydantic model has a type.
    
    But that type can itself be another Pydantic model.
    
    So, you can declare deeply nested JSON "objects" with specific attribute names, types and validations.
    
    All that, arbitrarily nested.
    
    ### Define a submodel
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  5. tests/test_jsonable_encoder.py

    from pathlib import PurePath, PurePosixPath, PureWindowsPath
    from typing import Optional
    
    import pytest
    from fastapi._compat import PYDANTIC_V2, Undefined
    from fastapi.encoders import jsonable_encoder
    from pydantic import BaseModel, Field, ValidationError
    
    from .utils import needs_pydanticv1, needs_pydanticv2
    
    
    class Person:
        def __init__(self, name: str):
            self.name = name
    
    
    class Pet:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 9K bytes
    - Viewed (0)
  6. docs/de/docs/how-to/conditional-openapi.md

    Wenn Sie Ihre API sichern möchten, gibt es mehrere bessere Dinge, die Sie tun können, zum Beispiel:
    
    * Stellen Sie sicher, dass Sie über gut definierte Pydantic-Modelle für Ihre Requestbodys und Responses verfügen.
    * Konfigurieren Sie alle erforderlichen Berechtigungen und Rollen mithilfe von Abhängigkeiten.
    * Speichern Sie niemals Klartext-Passwörter, sondern nur Passwort-Hashes.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_header_param_models/test_tutorial001.py

                                "user-agent": "testclient",
                            },
                        }
                    )
                    | IsDict(
                        # TODO: remove when deprecating Pydantic v1
                        {
                            "type": "value_error.missing",
                            "loc": ["header", "save_data"],
                            "msg": "field required",
                        }
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  8. docs/de/docs/tutorial/path-params.md

    <img src="/img/tutorial/path-params/image02.png">
    
    Und viele weitere kompatible Tools. Inklusive Codegenerierung für viele Sprachen.
    
    ## Pydantic
    
    Die ganze Datenvalidierung wird hinter den Kulissen von <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> durchgeführt, Sie profitieren also von dessen Vorteilen. Und Sie wissen, dass Sie in guten Händen sind.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  9. docs/de/docs/advanced/response-directly.md

    # Eine Response direkt zurückgeben
    
    Wenn Sie eine **FastAPI** *Pfadoperation* erstellen, können Sie normalerweise beliebige Daten davon zurückgeben: ein `dict`, eine `list`e, ein Pydantic-Modell, ein Datenbankmodell, usw.
    
    Standardmäßig konvertiert **FastAPI** diesen Rückgabewert automatisch nach JSON, mithilfe des `jsonable_encoder`, der in [JSON-kompatibler Encoder](../tutorial/encoder.md){.internal-link target=_blank} erläutert wird.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  10. docs/es/docs/advanced/response-directly.md

    # Devolver una respuesta directamente
    
    Cuando creas una *operación de path* normalmente puedes devolver cualquier dato: un `dict`, una `list`, un modelo Pydantic, un modelo de base de datos, etc.
    
    Por defecto, **FastAPI** convertiría automáticamente ese valor devuelto a JSON usando el `jsonable_encoder` explicado en [Codificador Compatible JSON](../tutorial/encoder.md){.internal-link target=_blank}.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top