Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 94 for pydantic (0.15 sec)

  1. docs/en/docs/tutorial/body.md

    {* ../../docs_src/body/tutorial002_py310.py *}
    
    /// info
    
    In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
    
    The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
    
    ///
    
    ## Request body + path parameters { #request-body-path-parameters }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:58:56 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/extra-models.md

    
    /// info
    
    In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
    
    The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
    
    ///
    
    ### About `**user_in.dict()` { #about-user-in-dict }
    
    #### Pydantic's `.dict()` { #pydantics-dict }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 7.2K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/dataclasses.md

    So, even with the code above that doesn't use Pydantic explicitly, FastAPI is using Pydantic to convert those standard dataclasses to Pydantic's own flavor of dataclasses.
    
    And of course, it supports the same:
    
    * data validation
    * data serialization
    * data documentation, etc.
    
    This works the same way as with Pydantic models. And it is actually achieved in the same way underneath, using Pydantic.
    
    /// info
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  4. 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 }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/schema-extra-example.md

    Here are several ways to do it.
    
    ## Extra JSON Schema data in Pydantic models { #extra-json-schema-data-in-pydantic-models }
    
    You can declare `examples` for a Pydantic model that will be added to the generated JSON Schema.
    
    //// tab | Pydantic v2
    
    {* ../../docs_src/schema_extra_example/tutorial001_py310.py hl[13:24] *}
    
    ////
    
    //// tab | Pydantic v1
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 9.6K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/body-updates.md

    ### Using Pydantic's `update` parameter { #using-pydantics-update-parameter }
    
    Now, you can create a copy of the existing model using `.model_copy()`, and pass the `update` parameter with a `dict` containing the data to update.
    
    /// info
    
    In Pydantic v1 the method was called `.copy()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_copy()`.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 4.7K bytes
    - Viewed (0)
  7. docs/en/docs/advanced/settings.md

    ## Pydantic `Settings` { #pydantic-settings }
    
    Fortunately, Pydantic provides a great utility to handle these settings coming from environment variables with <a href="https://docs.pydantic.dev/latest/concepts/pydantic_settings/" class="external-link" target="_blank">Pydantic: Settings management</a>.
    
    ### Install `pydantic-settings` { #install-pydantic-settings }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 12.2K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/response-model.md

        "price": 50.2
    }
    ```
    
    /// info
    
    In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
    
    The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
    
    ///
    
    /// info
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 16K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/cookie-param-models.md

    ///
    
    ## Cookies with a Pydantic Model { #cookies-with-a-pydantic-model }
    
    Declare the **cookie** parameters that you need in a **Pydantic model**, and then declare the parameter as `Cookie`:
    
    {* ../../docs_src/cookie_param_models/tutorial001_an_py310.py hl[9:12,16] *}
    
    **FastAPI** will **extract** the data for **each field** from the **cookies** received in the request and give you the Pydantic model you defined.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 3.1K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/path-operation-advanced-configuration.md

    //// tab | Pydantic v2
    
    {* ../../docs_src/path_operation_advanced_configuration/tutorial007.py hl[17:22, 24] *}
    
    ////
    
    //// tab | Pydantic v1
    
    {* ../../docs_src/path_operation_advanced_configuration/tutorial007_pv1.py hl[17:22, 24] *}
    
    ////
    
    /// info
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 7.8K bytes
    - Viewed (0)
Back to top