- Sort Score
- Num 10 results
- Language All
Results 31 - 40 of 493 for Annotated (0.1 seconds)
-
tests/test_dependency_partial.py
@app.get("/partial-function-dependency") async def get_partial_function_dependency( value: Annotated[ str, Depends(partial(function_dependency, "partial-function-dependency")) ], ) -> str: return value @app.get("/partial-async-function-dependency") async def get_partial_async_function_dependency( value: Annotated[ str, Depends(
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 6.3K bytes - Click Count (0) -
tests/test_annotated.py
import pytest from fastapi import APIRouter, FastAPI, Query from fastapi.testclient import TestClient app = FastAPI() @app.get("/default") async def default(foo: Annotated[str, Query()] = "foo"): return {"foo": foo} @app.get("/required") async def required(foo: Annotated[str, Query(min_length=1)]): return {"foo": foo} @app.get("/multiple")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 9.6K bytes - Click Count (0) -
docs/es/docs/tutorial/dependencies/classes-as-dependencies.md
Nota cómo escribimos `CommonQueryParams` dos veces en el código anterior: //// tab | Python 3.9+ ```Python commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)] ``` //// //// tab | Python 3.9+ sin `Annotated` /// tip | Consejo Prefiere usar la versión `Annotated` si es posible. /// ```Python commons: CommonQueryParams = Depends(CommonQueryParams) ``` ////
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 7.1K bytes - Click Count (0) -
fastapi/datastructures.py
``` """ file: Annotated[ BinaryIO, Doc("The standard Python file object (non-async)."), ] filename: Annotated[Optional[str], Doc("The original file name.")] size: Annotated[Optional[int], Doc("The size of the file in bytes.")] headers: Annotated[Headers, Doc("The headers of the request.")] content_type: Annotated[Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 5.1K bytes - Click Count (0) -
tests/test_request_params/test_file/test_optional_list.py
from typing import Annotated, Optional import pytest from fastapi import FastAPI, File, UploadFile from fastapi.testclient import TestClient from .utils import get_body_model_name app = FastAPI() # ===================================================================================== # Without aliases @app.post("/optional-list-bytes") async def read_optional_list_bytes(p: Annotated[Optional[list[bytes]], File()] = None):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 10.4K bytes - Click Count (0) -
docs/en/docs/tutorial/path-params-numeric-validations.md
## Import `Path` { #import-path } First, import `Path` from `fastapi`, and import `Annotated`: {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *} /// info FastAPI added support for `Annotated` (and started recommending it) in version 0.95.0. If you have an older version, you would get errors when trying to use `Annotated`.Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 6.1K bytes - Click Count (0) -
docs_src/dependencies/tutorial001_an_py39.py
from typing import Annotated, Union from fastapi import Depends, FastAPI app = FastAPI() async def common_parameters( q: Union[str, None] = None, skip: int = 0, limit: int = 100 ): return {"q": q, "skip": skip, "limit": limit} @app.get("/items/") async def read_items(commons: Annotated[dict, Depends(common_parameters)]): return commons @app.get("/users/")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 473 bytes - Click Count (0) -
docs/es/docs/tutorial/dependencies/index.md
/// info | Información FastAPI agregó soporte para `Annotated` (y comenzó a recomendarlo) en la versión 0.95.0. Si tienes una versión anterior, obtendrás errores al intentar usar `Annotated`. Asegúrate de [Actualizar la versión de FastAPI](../../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} al menos a la 0.95.1 antes de usar `Annotated`. /// ### Importar `Depends` { #import-depends }
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Dec 16 16:33:45 GMT 2025 - 10.1K bytes - Click Count (0) -
docs/es/docs/tutorial/query-params-str-validations.md
Asegúrate de [Actualizar la versión de FastAPI](../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} a al menos 0.95.1 antes de usar `Annotated`. /// ## Usar `Annotated` en el tipo del parámetro `q` { #use-annotated-in-the-type-for-the-q-parameter }
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 18.4K bytes - Click Count (0) -
fastapi/openapi/docs.py
import json from typing import Annotated, Any, Optional from annotated_doc import Doc from fastapi.encoders import jsonable_encoder from starlette.responses import HTMLResponse 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. """ ), ] = {Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 10.1K bytes - Click Count (0)