Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 195 for declare (0.05 sec)

  1. docs/en/docs/tutorial/path-params-numeric-validations.md

    ///
    
    ## Declare metadata { #declare-metadata }
    
    You can declare all the same parameters as for `Query`.
    
    For example, to declare a `title` metadata value for the path parameter `item_id` you can type:
    
    {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[10] *}
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 6.2K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/body.md

    ```JSON
    {
        "name": "Foo",
        "price": 45.2
    }
    ```
    
    ## Declare it as a parameter { #declare-it-as-a-parameter }
    
    To add it to your *path operation*, declare it the same way you declared path and query parameters:
    
    {* ../../docs_src/body/tutorial001_py310.py hl[16] *}
    
    ...and declare its type as the model you created, `Item`.
    
    ## Results { #results }
    
    With just that Python type declaration, **FastAPI** will:
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:58:56 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/cookie-params.md

    ## Import `Cookie` { #import-cookie }
    
    First import `Cookie`:
    
    {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3] *}
    
    ## Declare `Cookie` parameters { #declare-cookie-parameters }
    
    Then declare the cookie parameters using the same structure as with `Path` and `Query`.
    
    You can define the default value as well as all the extra validation or annotation parameters:
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 1.1K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/request-form-models.md

    ///
    
    /// note
    
    This is supported since FastAPI version `0.113.0`. 🤓
    
    ///
    
    ## Pydantic Models for Forms { #pydantic-models-for-forms }
    
    You just need to declare a **Pydantic model** with the fields you want to receive as **form fields**, and then declare the parameter as `Form`:
    
    {* ../../docs_src/request_form_models/tutorial001_an_py39.py hl[9:11,15] *}
    
    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/query-params.md

    You can declare multiple path parameters and query parameters at the same time, **FastAPI** knows which is which.
    
    And you don't have to declare them in any specific order.
    
    They will be detected by name:
    
    {* ../../docs_src/query_params/tutorial004_py310.py hl[6,8] *}
    
    ## Required query parameters { #required-query-parameters }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:29:01 UTC 2025
    - 4.5K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/body-fields.md

    # Body - Fields { #body-fields }
    
    The same way you can declare additional validation and metadata in *path operation function* parameters with `Query`, `Path` and `Body`, you can declare validation and metadata inside of Pydantic models using Pydantic's `Field`.
    
    ## Import `Field` { #import-field }
    
    First, you have to import it:
    
    {* ../../docs_src/body_fields/tutorial001_an_py310.py hl[4] *}
    
    
    /// warning
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  7. docs/pt/docs/tutorial/cookie-params.md

    ## Importe `Cookie`
    
    Primeiro importe `Cookie`:
    
    {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3] *}
    
    ## Declare parâmetros de `Cookie`
    
    Então declare os paramêtros de cookie usando a mesma estrutura que em `Path` e `Query`.
    
    Você pode definir o valor padrão, assim como todas as validações extras ou parâmetros de anotação:
    
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/header-params.md

    ## importe `Header`
    
    Primeiro importe `Header`:
    
    {* ../../docs_src/header_params/tutorial001_py310.py hl[1] *}
    
    ## Declare parâmetros de `Header`
    
    Então declare os paramêtros de cabeçalho usando a mesma estrutura que em `Path`, `Query` e `Cookie`.
    
    O primeiro valor é o valor padrão, você pode passar todas as validações adicionais ou parâmetros de anotação:
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/header-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`. 🤓
    
    ///
    
    ## Header Parameters with a Pydantic Model { #header-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.6K bytes
    - Viewed (0)
  10. docs/fr/docs/tutorial/body.md

    ```JSON
    {
        "name": "Foo",
        "price": 45.2
    }
    ```
    
    ## Déclarez-le comme paramètre
    
    Pour l'ajouter à votre *opération de chemin*, déclarez-le comme vous déclareriez des paramètres de chemin ou de requête :
    
    {* ../../docs_src/body/tutorial001.py hl[18] *}
    
    ...et déclarez que son type est le modèle que vous avez créé : `Item`.
    
    ## Résultats
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sat Nov 09 16:39:20 UTC 2024
    - 7.6K bytes
    - Viewed (0)
Back to top