Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 913 for annotated (0.14 sec)

  1. docs_src/path_params_numeric_validations/tutorial006_an.py

    from fastapi import FastAPI, Path, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        *,
        item_id: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: str,
        size: Annotated[float, Query(gt=0, lt=10.5)],
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 405 bytes
    - Viewed (0)
  2. fastapi/openapi/docs.py

    import json
    from typing import Any, Dict, Optional
    
    from fastapi.encoders import jsonable_encoder
    from starlette.responses import HTMLResponse
    from typing_extensions import Annotated, Doc
    
    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: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu May 23 22:59:02 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial005_an.py

    from typing import Union
    
    from fastapi import Cookie, Depends, FastAPI
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    def query_extractor(q: Union[str, None] = None):
        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[Union[str, None], Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 558 bytes
    - Viewed (0)
  4. docs/en/docs/advanced/advanced-dependencies.md

        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="11"
        {!> ../../../docs_src/dependencies/tutorial011_an.py!}
        ```
    
    === "Python 3.8+ non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="10"
        {!> ../../../docs_src/dependencies/tutorial011.py!}
        ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 17 05:59:11 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  5. fastapi/exceptions.py

            return {"item": items[item_id]}
        ```
        """
    
        def __init__(
            self,
            status_code: Annotated[
                int,
                Doc(
                    """
                    HTTP status code to send to the client.
                    """
                ),
            ],
            detail: Annotated[
                Any,
                Doc(
                    """
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Apr 02 02:48:51 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="18"
        {!> ../../../docs_src/dependencies/tutorial006_an.py!}
        ```
    
    === "Python 3.8 non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="17"
        {!> ../../../docs_src/dependencies/tutorial006.py!}
        ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat May 18 23:43:13 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  7. docs_src/security/tutorial004_an_py39.py

        return user
    
    
    async def get_current_active_user(
        current_user: Annotated[User, Depends(get_current_user)],
    ):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    async def login_for_access_token(
        form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
    ) -> Token:
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  8. docs/uk/docs/tutorial/body-fields.md

        ```
    
    === "Python 3.10+ non-Annotated"
    
        !!! tip
            Варто користуватись `Annotated` версією, якщо це можливо.
    
        ```Python hl_lines="2"
        {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
        ```
    
    === "Python 3.8+ non-Annotated"
    
        !!! tip
            Варто користуватись `Annotated` версією, якщо це можливо.
    
        ```Python hl_lines="4"
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Jan 09 15:25:48 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  9. docs_src/security/tutorial003_an_py310.py

            )
        return user
    
    
    async def get_current_active_user(
        current_user: Annotated[User, Depends(get_current_user)],
    ):
        if current_user.disabled:
            raise HTTPException(status_code=400, detail="Inactive user")
        return current_user
    
    
    @app.post("/token")
    async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
        user_dict = fake_users_db.get(form_data.username)
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/body-multiple-params.md

        ```
    
    === "Python 3.10+ non-Annotated"
    
        !!! tip
            尽可能选择使用 `Annotated` 的版本。
    
        ```Python hl_lines="17-19"
        {!> ../../../docs_src/body_multiple_params/tutorial001_py310.py!}
        ```
    
    === "Python 3.8+ non-Annotated"
    
        !!! tip
            尽可能选择使用 `Annotated` 的版本。
    
        ```Python hl_lines="19-21"
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 17 05:59:11 UTC 2023
    - 7.6K bytes
    - Viewed (0)
Back to top