- Sort Score
- Num 10 results
- Language All
Results 21 - 30 of 437 for annotated (0.05 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
tests/test_annotated.py
from typing import Annotated import pytest from fastapi import APIRouter, FastAPI, Query from fastapi.testclient import TestClient from inline_snapshot import snapshot 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 Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 10.5K bytes - Click Count (0) -
fastapi/applications.py
return func return decorator def include_router( self, router: Annotated[routing.APIRouter, Doc("The `APIRouter` to include.")], *, prefix: Annotated[str, Doc("An optional path prefix for the router.")] = "", tags: Annotated[ list[str | Enum] | None, Doc( """Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Apr 01 16:16:24 GMT 2026 - 178.6K bytes - Click Count (0) -
tests/test_request_params/test_file/test_optional_list.py
from typing import Annotated 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[list[bytes] | None, File()] = None):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 21 13:01:31 GMT 2026 - 10.8K bytes - Click Count (0) -
docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md
위 코드에서 `CommonQueryParams`를 두 번 작성하는 방식에 주목하세요: //// tab | Python 3.10+ ```Python commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)] ``` //// //// tab | Python 3.10+ Annotated 미사용 /// tip | 팁 가능하다면 `Annotated` 버전을 사용하는 것을 권장합니다. /// ```Python commons: CommonQueryParams = Depends(CommonQueryParams) ``` ////
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:57:01 GMT 2026 - 8K bytes - Click Count (0) -
docs_src/additional_status_codes/tutorial001_an_py310.py
from typing import Annotated from fastapi import Body, FastAPI, status from fastapi.responses import JSONResponse app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: Annotated[str | None, Body()] = None, size: Annotated[int | None, Body()] = None, ): if item_id in items:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 686 bytes - Click Count (0) -
docs/ja/docs/tutorial/path-params-numeric-validations.md
## `Path`のインポート { #import-path } まず初めに、`fastapi`から`Path`をインポートし、`Annotated`もインポートします: {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *} /// info | 情報 FastAPI はバージョン 0.95.0 で`Annotated`のサポートを追加し(そして推奨し始めました)。 古いバージョンの場合、`Annotated`を使おうとするとエラーになります。 `Annotated`を使用する前に、FastAPI のバージョンを少なくとも 0.95.1 まで[アップグレードしてください](../deployment/versions.md#upgrading-the-fastapi-versions)。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 7.6K bytes - Click Count (0) -
docs/zh/docs/tutorial/dependencies/classes-as-dependencies.md
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 13:37:57 GMT 2026 - 6.8K bytes - Click Count (0) -
docs_src/websockets_/tutorial002_an_py310.py
</body> </html> """ @app.get("/") async def get(): return HTMLResponse(html) async def get_cookie_or_token( websocket: WebSocket, session: Annotated[str | None, Cookie()] = None, token: Annotated[str | None, Query()] = None, ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 12:34:37 GMT 2026 - 2.8K bytes - Click Count (0) -
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 Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 6.3K bytes - Click Count (0) -
docs_src/extra_data_types/tutorial001_an_py310.py
from typing import Annotated 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[time | None, Body()] = None, ):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Apr 19 00:11:40 GMT 2024 - 788 bytes - Click Count (0)