Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 419 for declare (0.18 sec)

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

    ```JSON
    {
        "name": "Foo",
        "price": 45.2
    }
    ```
    
    ## Declare it as a parameter
    
    To add it to your *path operation*, declare it the same way you declared path and query parameters:
    
    === "Python 3.10+"
    
        ```Python hl_lines="16"
        {!> ../../../docs_src/body/tutorial001_py310.py!}
        ```
    
    === "Python 3.8+"
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/body-fields.md

    # 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`
    
    First, you have to import it:
    
    === "Python 3.10+"
    
        ```Python hl_lines="4"
        {!> ../../../docs_src/body_fields/tutorial001_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/path-params-numeric-validations.md

        Make sure you [Upgrade the FastAPI version](../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} to at least 0.95.1 before using `Annotated`.
    
    ## 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:
    
    === "Python 3.10+"
    
        ```Python hl_lines="10"
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  4. build-logic/integration-testing/src/main/kotlin/gradlebuild/integrationtests/shared-configuration.kt

            val distributionRuntimeOnly = bucket("${prefix}TestDistributionRuntimeOnly", "Declare the distribution that is required to run tests")
            val localRepository = bucket("${prefix}TestLocalRepository", "Declare a local repository required as input data for the tests (e.g. :tooling-api)")
    Plain Text
    - Registered: Wed Mar 27 11:36:08 GMT 2024
    - Last Modified: Mon Feb 12 13:19:06 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  5. docs/pt/docs/tutorial/body.md

    ```JSON
    {
        "name": "Foo",
        "price": 45.2
    }
    ```
    
    ## Declare como um parâmetro
    
    Para adicionar o corpo na *função de operação de rota*, declare-o da mesma maneira que você declarou parâmetros de rota e consulta:
    
    ```Python hl_lines="18"
    {!../../../docs_src/body/tutorial001.py!}
    ```
    
    ...E declare o tipo como o modelo que você criou, `Item`.
    
    ## Resultados
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/path-params.md

    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Path parameters with types
    
    You can declare the type of a path parameter in the function, using standard Python type annotations:
    
    ```Python hl_lines="7"
    {!../../../docs_src/path_params/tutorial002.py!}
    ```
    
    In this case, `item_id` is declared to be an `int`.
    
    !!! check
        This will give you editor support inside of your function, with error checks, completion, etc.
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/request-forms.md

    !!! warning
        You can declare multiple `Form` parameters in a *path operation*, but you can't also declare `Body` fields that you expect to receive as JSON, as the request will have the body encoded using `application/x-www-form-urlencoded` instead of `application/json`.
    
        This is not a limitation of **FastAPI**, it's part of the HTTP protocol.
    
    ## Recap
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/path-operation-advanced-configuration.md

    {!../../../docs_src/path_operation_advanced_configuration/tutorial004.py!}
    ```
    
    ## Additional Responses
    
    You probably have seen how to declare the `response_model` and `status_code` for a *path operation*.
    
    That defines the metadata about the main response of a *path operation*.
    
    You can also declare additional responses with their models, status codes, etc.
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  9. docs/en/docs/advanced/response-change-status-code.md

    And if you declared a `response_model`, it will still be used to filter and convert the object you returned.
    
    **FastAPI** will use that *temporal* response to extract the status code (also cookies and headers), and will put them in the final response that contains the value you returned, filtered by any `response_model`.
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/response-model.md

    !!! tip
        If you have strict type checks in your editor, mypy, etc, you can declare the function return type as `Any`.
    
        That way you tell the editor that you are intentionally returning anything. But FastAPI will still do the data documentation, validation, filtering, etc. with the `response_model`.
    
    ### `response_model` Priority
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
Back to top