Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 498 for Annotated (0.11 sec)

  1. tests/test_dependency_partial.py

    @app.get("/partial-function-dependency")
    async def get_partial_function_dependency(
        value: Annotated[
            str, Depends(partial(function_dependency, "partial-function-dependency"))
        ],
    ) -> str:
        return value
    
    
    @app.get("/partial-async-function-dependency")
    async def get_partial_async_function_dependency(
        value: Annotated[
            str,
            Depends(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 6.3K bytes
    - Viewed (0)
  2. docs/ru/docs/tutorial/dependencies/index.md

    /// info | Информация
    
    FastAPI добавил поддержку `Annotated` (и начал рекомендовать его использование) в версии 0.95.0.
    
    Если у вас более старая версия, вы получите ошибки при попытке использовать `Annotated`.
    
    Убедитесь, что вы [обновили версию FastAPI](../../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} как минимум до 0.95.1, прежде чем использовать `Annotated`.
    
    ///
    
    ### Импорт `Depends` { #import-depends }
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 30 11:24:39 UTC 2025
    - 15.4K bytes
    - Viewed (1)
  3. docs/es/docs/tutorial/dependencies/classes-as-dependencies.md

    Nota cómo escribimos `CommonQueryParams` dos veces en el código anterior:
    
    //// tab | Python 3.9+
    
    ```Python
    commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
    ```
    
    ////
    
    //// tab | Python 3.9+ sin `Annotated`
    
    /// tip | Consejo
    
    Prefiere usar la versión `Annotated` si es posible.
    
    ///
    
    ```Python
    commons: CommonQueryParams = Depends(CommonQueryParams)
    ```
    
    ////
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  4. tests/test_request_params/test_file/test_optional_list.py

    from typing import Annotated, Optional
    
    import pytest
    from fastapi import FastAPI, File, UploadFile
    from fastapi.testclient import TestClient
    
    from .utils import get_body_model_name
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.post("/optional-list-bytes")
    async def read_optional_list_bytes(p: Annotated[Optional[list[bytes]], File()] = None):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/path-params-numeric-validations.md

    ## Import `Path` { #import-path }
    
    First, import `Path` from `fastapi`, and import `Annotated`:
    
    {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *}
    
    /// info
    
    FastAPI added support for `Annotated` (and started recommending it) in version 0.95.0.
    
    If you have an older version, you would get errors when trying to use `Annotated`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 6.1K bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial001_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    async def common_parameters(
        q: Union[str, None] = None, skip: int = 0, limit: int = 100
    ):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: Annotated[dict, Depends(common_parameters)]):
        return commons
    
    
    @app.get("/users/")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 473 bytes
    - Viewed (0)
  7. fastapi/datastructures.py

        ```
        """
    
        file: Annotated[
            BinaryIO,
            Doc("The standard Python file object (non-async)."),
        ]
        filename: Annotated[Optional[str], Doc("The original file name.")]
        size: Annotated[Optional[int], Doc("The size of the file in bytes.")]
        headers: Annotated[Headers, Doc("The headers of the request.")]
        content_type: Annotated[
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  8. docs/es/docs/tutorial/query-params-str-validations.md

    Asegúrate de [Actualizar la versión de FastAPI](../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} a al menos 0.95.1 antes de usar `Annotated`.
    
    ///
    
    ## Usar `Annotated` en el tipo del parámetro `q` { #use-annotated-in-the-type-for-the-q-parameter }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 18.4K bytes
    - Viewed (0)
  9. docs_src/additional_status_codes/tutorial001_an_py310.py

    from typing import Annotated
    
    from fastapi import Body, FastAPI, status
    from fastapi.responses import JSONResponse
    
    app = FastAPI()
    
    items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}}
    
    
    @app.put("/items/{item_id}")
    async def upsert_item(
        item_id: str,
        name: Annotated[str | None, Body()] = None,
        size: Annotated[int | None, Body()] = None,
    ):
        if item_id in items:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 686 bytes
    - Viewed (0)
  10. fastapi/openapi/docs.py

    import json
    from typing import Annotated, Any, Optional
    
    from annotated_doc import Doc
    from fastapi.encoders import jsonable_encoder
    from starlette.responses import HTMLResponse
    
    swagger_ui_default_parameters: Annotated[
        dict[str, Any],
        Doc(
            """
            Default configurations for Swagger UI.
    
            You can use it as a template to add any other configurations needed.
            """
        ),
    ] = {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 10.1K bytes
    - Viewed (0)
Back to top