Search Options

Results per page
Sort
Preferred Languages
Advance

Results 171 - 180 of 913 for annotated (0.41 sec)

  1. docs_src/path_params_numeric_validations/tutorial004_an.py

    from fastapi import FastAPI, Path
    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=1)], q: str
    ):
        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
    - 327 bytes
    - Viewed (0)
  2. docs_src/query_params_str_validations/tutorial006_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str, Query(min_length=3)]):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        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
    - 294 bytes
    - Viewed (0)
  3. docs_src/security/tutorial006_an.py

    from fastapi import Depends, FastAPI
    from fastapi.security import HTTPBasic, HTTPBasicCredentials
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    security = HTTPBasic()
    
    
    @app.get("/users/me")
    def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 371 bytes
    - Viewed (0)
  4. docs_src/security/tutorial006_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    from fastapi.security import HTTPBasic, HTTPBasicCredentials
    
    app = FastAPI()
    
    security = HTTPBasic()
    
    
    @app.get("/users/me")
    def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 361 bytes
    - Viewed (0)
  5. docs_src/path_params_numeric_validations/tutorial005_an.py

    from fastapi import FastAPI, Path
    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", gt=0, le=1000)],
        q: str,
    ):
        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
    - 341 bytes
    - Viewed (0)
  6. docs_src/bigger_applications/app_an/dependencies.py

    from fastapi import Header, HTTPException
    from typing_extensions import Annotated
    
    
    async def get_token_header(x_token: Annotated[str, Header()]):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def get_query_token(token: str):
        if token != "jessica":
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 419 bytes
    - Viewed (0)
  7. docs_src/bigger_applications/app_an_py39/dependencies.py

    from typing import Annotated
    
    from fastapi import Header, HTTPException
    
    
    async def get_token_header(x_token: Annotated[str, Header()]):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def get_query_token(token: str):
        if token != "jessica":
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 409 bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/schema-extra-example.md

        ```
    
    === "Python 3.10+ non-Annotated"
    
        !!! tip Заметка
            Рекомендуется использовать версию с `Annotated`, если это возможно.
    
        ```Python hl_lines="18-23"
        {!> ../../../docs_src/schema_extra_example/tutorial003_py310.py!}
        ```
    
    === "Python 3.8+ non-Annotated"
    
        !!! tip Заметка
            Рекомендуется использовать версию с `Annotated`, если это возможно.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Mar 22 01:42:11 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  9. docs_src/python_types/tutorial013.py

    from typing_extensions import Annotated
    
    
    def say_hello(name: Annotated[str, "this is just metadata"]) -> str:
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 138 bytes
    - Viewed (0)
  10. docs_src/python_types/tutorial013_py39.py

    from typing import Annotated
    
    
    def say_hello(name: Annotated[str, "this is just metadata"]) -> str:
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 127 bytes
    - Viewed (0)
Back to top