- Sort Score
- Num 10 results
- Language All
Results 1131 - 1140 of 1,304 for DEF (0.03 seconds)
-
docs_src/body_nested_models/tutorial001_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 402 bytes - Click Count (0) -
docs_src/header_param_models/tutorial002_an_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Sep 17 18:54:10 GMT 2024 - 451 bytes - Click Count (0) -
docs_src/path_params_numeric_validations/tutorial001_an_py310.py
from typing import Annotated from fastapi import FastAPI, Path, Query app = FastAPI() @app.get("/items/{item_id}") async def read_items( item_id: Annotated[int, Path(title="The ID of the item to get")], q: Annotated[str | None, Query(alias="item-query")] = None, ): results = {"item_id": item_id} if q: results.update({"q": q})
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 375 bytes - Click Count (0) -
docs_src/pydantic_v1_in_v2/tutorial003_an_py310.py
size: float class ItemV2(BaseModelV2): name: str description: str | None = None size: float app = FastAPI() @app.post("/items/", response_model=ItemV2) async def create_item(item: Item):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Oct 11 16:45:54 GMT 2025 - 407 bytes - Click Count (0) -
docs/zh/docs/tutorial/testing.md
像使用 `httpx` 那样使用 `TestClient` 对象。 为你需要检查的地方用标准的Python表达式写个简单的 `assert` 语句(重申,标准的`pytest`)。 {* ../../docs_src/app_testing/tutorial001.py hl[2,12,15:18] *} /// tip | 提示 注意测试函数是普通的 `def`,不是 `async def`。 还有client的调用也是普通的调用,不是用 `await`。 这让你可以直接使用 `pytest` 而不会遇到麻烦。 /// /// note | 技术细节 你也可以用 `from starlette.testclient import TestClient`。Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Oct 11 17:48:49 GMT 2025 - 5.9K bytes - Click Count (0) -
fastapi/cli.py
try: from fastapi_cli.cli import main as cli_main except ImportError: # pragma: no cover cli_main = None # type: ignore def main() -> None: if not cli_main: # type: ignore[truthy-function] message = 'To use the fastapi command, please install "fastapi[standard]":\n\n\tpip install "fastapi[standard]"\n' print(message) raise RuntimeError(message) # noqa: B904Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Aug 02 06:03:05 GMT 2024 - 418 bytes - Click Count (0) -
docs_src/body_nested_models/tutorial002_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 407 bytes - Click Count (0) -
docs_src/query_param_models/tutorial001_py310.py
limit: int = Field(100, gt=0, le=100) offset: int = Field(0, ge=0) order_by: Literal["created_at", "updated_at"] = "created_at" tags: list[str] = [] @app.get("/items/") async def read_items(filter_query: FilterParams = Query()):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Sep 17 18:54:10 GMT 2024 - 422 bytes - Click Count (0) -
tests/test_tutorial/test_custom_response/test_tutorial009.py
from pathlib import Path from fastapi.testclient import TestClient from docs_src.custom_response import tutorial009_py39 from docs_src.custom_response.tutorial009_py39 import app client = TestClient(app) def test_get(tmp_path: Path): file_path: Path = tmp_path / "large-video-file.mp4" tutorial009_py39.some_file_path = str(file_path) test_content = b"Fake video bytes" file_path.write_bytes(test_content)
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 502 bytes - Click Count (0) -
build-logic/documentation/src/main/groovy/gradlebuild/docs/dsl/docbook/model/MethodDoc.groovy
this.referringClass = referringClass id = "$referringClass.className:$metaData.overrideSignature" this.comment = comment } MethodDoc forClass(ClassDoc referringClass) { def refererMetaData = referringClass.classMetaData if (refererMetaData == this.referringClass) { return this } return new MethodDoc(refererMetaData, metaData, comment) }Created: Wed Dec 31 11:36:14 GMT 2025 - Last Modified: Wed Dec 09 08:14:05 GMT 2020 - 2.3K bytes - Click Count (0)