- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 220 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) -
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/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) -
tests/test_security_scopes_sub_dependency.py
security_scopes: SecurityScopes, db_session: Annotated[str, Depends(get_db_session)], ): call_counts["get_current_user"] += 1 return { "user": f"user_{call_counts['get_current_user']}", "scopes": security_scopes.scopes, "db_session": db_session, } def get_user_me( current_user: Annotated[dict, Security(get_current_user, scopes=["me"])], ):Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 2.9K bytes - Viewed (0) -
tests/test_request_params/test_form/test_optional_list.py
): return {"p": p} class FormModelOptionalListStr(BaseModel): p: Optional[list[str]] = None @app.post("/model-optional-list-str", operation_id="model_optional_list_str") async def read_model_optional_list_str(p: Annotated[FormModelOptionalListStr, Form()]): return {"p": p.p} @pytest.mark.parametrize( "path",Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 9.9K bytes - Viewed (0)