Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 534 for annotated (0.04 sec)

  1. fastapi/param_functions.py

        ] = None,
        max_length: Annotated[
            Optional[int],
            Doc(
                """
                Maximum length for strings.
                """
            ),
        ] = None,
        pattern: Annotated[
            Optional[str],
            Doc(
                """
                RegEx pattern for strings.
                """
            ),
        ] = None,
        regex: Annotated[
            Optional[str],
            Doc(
    Registered: 2025-05-25 07:19
    - Last Modified: 2024-10-23 18:30
    - 62.5K bytes
    - Viewed (0)
  2. fastapi/routing.py

                return func
    
            return decorator
    
        def include_router(
            self,
            router: Annotated["APIRouter", Doc("The `APIRouter` to include.")],
            *,
            prefix: Annotated[str, Doc("An optional path prefix for the router.")] = "",
            tags: Annotated[
                Optional[List[Union[str, Enum]]],
                Doc(
                    """
    Registered: 2025-05-25 07:19
    - Last Modified: 2025-03-06 12:18
    - 172.1K bytes
    - Viewed (0)
  3. fastapi/security/oauth2.py

        ## Example
    
        ```python
        from typing import Annotated
    
        from fastapi import Depends, FastAPI
        from fastapi.security import OAuth2PasswordRequestForm
    
        app = FastAPI()
    
    
        @app.post("/login")
        def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
            data = {}
            data["scopes"] = []
    Registered: 2025-05-25 07:19
    - Last Modified: 2025-01-30 12:17
    - 21.1K bytes
    - Viewed (0)
  4. tests/test_ambiguous_params.py

        async def get(foo: Annotated[int, Query(gt=2), Query(lt=10)]):
            return foo
    
        with pytest.raises(
            AssertionError,
            match=(
                "Cannot specify `Depends` in `Annotated` and default value"
                " together for 'foo'"
            ),
        ):
    
            @app.get("/")
            async def get2(foo: Annotated[int, Depends(dep)] = Depends(dep)):
                pass  # pragma: nocover
    
        with pytest.raises(
    Registered: 2025-05-25 07:19
    - Last Modified: 2023-12-12 00:22
    - 2.1K bytes
    - Viewed (0)
  5. fastapi/security/http.py

    from typing_extensions import Annotated, Doc
    
    
    class HTTPBasicCredentials(BaseModel):
        """
        The HTTP Basic credentials given as the result of using `HTTPBasic` in a
        dependency.
    
        Read more about it in the
        [FastAPI docs for HTTP Basic Auth](https://fastapi.tiangolo.com/advanced/security/http-basic-auth/).
        """
    
        username: Annotated[str, Doc("The HTTP Basic username.")]
    Registered: 2025-05-25 07:19
    - Last Modified: 2025-02-27 12:29
    - 13.3K bytes
    - Viewed (0)
  6. docs/pt/docs/tutorial/dependencies/classes-as-dependencies.md

    Perceba como escrevemos `CommonQueryParams` duas vezes no código abaixo:
    
    //// tab | Python 3.8+
    
    ```Python
    commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
    ```
    
    ////
    
    //// tab | Python 3.8+ non-Annotated
    
    /// tip | Dica
    
    Utilize a versão com `Annotated` se possível.
    
    ///
    
    ```Python
    commons: CommonQueryParams = Depends(CommonQueryParams)
    ```
    
    ////
    
    Registered: 2025-05-25 07:19
    - Last Modified: 2024-11-18 02:25
    - 7K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

    Notice how we write `CommonQueryParams` twice in the above code:
    
    //// tab | Python 3.8+
    
    ```Python
    commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
    ```
    
    ////
    
    //// tab | Python 3.8+ non-Annotated
    
    /// tip
    
    Prefer to use the `Annotated` version if possible.
    
    ///
    
    ```Python
    commons: CommonQueryParams = Depends(CommonQueryParams)
    ```
    
    ////
    
    Registered: 2025-05-25 07:19
    - Last Modified: 2024-11-10 01:11
    - 6.6K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/query-params-str-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`.
    
    ///
    
    ## Use `Annotated` in the type for the `q` parameter
    
    Registered: 2025-05-25 07:19
    - Last Modified: 2025-03-01 22:02
    - 16.4K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/dependencies/classes-as-dependencies.md

    //// tab | Python 3.6+ без Annotated
    
    /// tip | Подсказка
    
    Рекомендуется использовать версию с `Annotated` если возможно.
    
    ///
    
    ```Python
    commons: CommonQueryParams = Depends(CommonQueryParams)
    ```
    
    ////
    
    //// tab | Python 3.6+
    
    ```Python
    commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
    ```
    
    ////
    
    Registered: 2025-05-25 07:19
    - Last Modified: 2024-11-18 02:25
    - 10.4K bytes
    - Viewed (0)
  10. docs/es/docs/tutorial/dependencies/classes-as-dependencies.md

    Nota cómo escribimos `CommonQueryParams` dos veces en el código anterior:
    
    //// tab | Python 3.8+
    
    ```Python
    commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
    ```
    
    ////
    
    //// tab | Python 3.8+ sin `Annotated`
    
    /// tip | Consejo
    
    Prefiere usar la versión `Annotated` si es posible.
    
    ///
    
    ```Python
    commons: CommonQueryParams = Depends(CommonQueryParams)
    ```
    
    ////
    
    Registered: 2025-05-25 07:19
    - Last Modified: 2024-12-30 18:26
    - 6.9K bytes
    - Viewed (0)
Back to top