- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 498 for Annotated (0.04 sec)
-
tests/test_ambiguous_params.py
@app.get("/multi-query") 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)):Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 2K bytes - Viewed (1) -
fastapi/security/http.py
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.")] password: Annotated[str, Doc("The HTTP Basic password.")] class HTTPAuthorizationCredentials(BaseModel): """ The HTTP authorization credentials in the result of using `HTTPBearer` orRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 13.2K bytes - Viewed (0) -
docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
Notice how we write `CommonQueryParams` twice in the above code: //// tab | Python 3.9+ ```Python commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)] ``` //// //// tab | Python 3.9+ non-Annotated /// tip Prefer to use the `Annotated` version if possible. /// ```Python commons: CommonQueryParams = Depends(CommonQueryParams) ``` ////
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 6.7K bytes - Viewed (0) -
docs/pt/docs/tutorial/dependencies/classes-as-dependencies.md
Perceba como escrevemos `CommonQueryParams` duas vezes no código abaixo: //// tab | Python 3.9+ ```Python commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)] ``` //// //// tab | Python 3.9+ non-Annotated /// tip | Dica Utilize a versão com `Annotated` se possível. /// ```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.3K bytes - Viewed (0) -
docs/uk/docs/tutorial/query-params-str-validations.md
### Імпорт `Query` та `Annotated` Щоб це зробити, спочатку імпортуємо: * `Query` з `fastapi` * `Annotated` з `typing` {* ../../docs_src/query_params_str_validations/tutorial002_an_py310.py hl[1,3] *} /// info | Інформація FastAPI додав підтримку `Annotated` (і почав рекомендувати його) у версії 0.95.0. Якщо у Вас старіша версія, під час використання `Annotated` можуть виникати помилки.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri May 30 14:17:24 UTC 2025 - 26.1K bytes - Viewed (0) -
tests/test_union_body_discriminator_annotated.py
return v.get("pet_type", "") Pet = Annotated[ Union[Annotated[Cat, Tag("cat")], Annotated[Dog, Tag("dog")]], Discriminator(get_pet_type), ] app = FastAPI() @app.post("/pet/assignment") async def create_pet_assignment(pet: Pet = Body()): return pet @app.post("/pet/annotated") async def create_pet_annotated(pet: Annotated[Pet, Body()]): return pet
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 7.7K bytes - Viewed (0) -
docs_src/extra_data_types/tutorial001_an_py39.py
from typing import Annotated, Union from uuid import UUID from fastapi import Body, FastAPI app = FastAPI() @app.put("/items/{item_id}") async def read_items( item_id: UUID, start_datetime: Annotated[datetime, Body()], end_datetime: Annotated[datetime, Body()], process_after: Annotated[timedelta, Body()], repeat_at: Annotated[Union[time, None], Body()] = None, ):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Apr 19 00:11:40 UTC 2024 - 801 bytes - Viewed (0) -
fastapi/param_functions.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 12:54:56 UTC 2025 - 63K bytes - Viewed (0) -
docs_src/dependencies/tutorial005_an_py310.py
from typing import Annotated from fastapi import Cookie, Depends, FastAPI app = FastAPI() def query_extractor(q: str | None = None): return q def query_or_cookie_extractor( q: Annotated[str, Depends(query_extractor)], last_query: Annotated[str | None, Cookie()] = None, ): if not q: return last_query return q @app.get("/items/") async def read_query(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Mar 26 16:56:53 UTC 2024 - 510 bytes - Viewed (0) -
docs/pt/docs/tutorial/path-params-numeric-validations.md
## Importe `Path` { #import-path } Primeiro, importe `Path` de `fastapi`, e importe `Annotated`: {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *} /// info | Informação O FastAPI adicionou suporte a `Annotated` (e passou a recomendá-lo) na versão 0.95.0. Se você tiver uma versão mais antiga, verá erros ao tentar usar `Annotated`.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 6.7K bytes - Viewed (0)