- Sort Score
- Num 10 results
- Language All
Results 221 - 230 of 880 for resync (0.07 seconds)
-
docs_src/response_model/tutorial005_py310.py
} @app.get( "/items/{item_id}/name", response_model=Item, response_model_include={"name", "description"}, ) async def read_item_name(item_id: str): return items[item_id] @app.get("/items/{item_id}/public", response_model=Item, response_model_exclude={"tax"}) async def read_item_public_data(item_id: str):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 816 bytes - Click Count (0) -
tests/test_dependency_pep695.py
from fastapi.testclient import TestClient from typing_extensions import TypeAliasType async def some_value() -> int: return 123 DependedValue = TypeAliasType( "DependedValue", Annotated[int, Depends(some_value)], type_params=() ) def test_pep695_type_dependencies(): app = FastAPI() @app.get("/") async def get_with_dep(value: DependedValue) -> str: # noqa return f"value: {value}"
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 05 18:34:34 GMT 2026 - 628 bytes - Click Count (0) -
docs_src/response_model/tutorial001_py310.py
description: str | None = None price: float tax: float | None = None tags: list[str] = [] @app.post("/items/", response_model=Item) async def create_item(item: Item) -> Any: return item @app.get("/items/", response_model=list[Item]) async def read_items() -> Any: return [ {"name": "Portal Gun", "price": 42.0}, {"name": "Plumbus", "price": 32.0},Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Jan 07 13:45:48 GMT 2023 - 537 bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/server-sent-events.md
/// tip 因為 Pydantic 會在 **Rust** 端進行序列化,如果你有宣告回傳型別,效能會比未宣告時高很多。 /// ### 非 async 的路徑操作函式 { #non-async-path-operation-functions } 你也可以使用一般的 `def` 函式(沒有 `async`),並同樣使用 `yield`。 FastAPI 會確保正確執行,不會阻塞事件迴圈。 由於此函式不是 async,正確的回傳型別是 `Iterable[Item]`: {* ../../docs_src/server_sent_events/tutorial001_py310.py ln[28:31] hl[29] *} ### 無回傳型別 { #no-return-type }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:33:04 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/ru/docs/tutorial/request-files.md
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 11.4K bytes - Click Count (0) -
docs/zh/docs/advanced/dataclasses.md
7. 这里的 `response_model` 使用了 “`Author` 数据类列表” 的类型注解。 同样,你可以将 `dataclasses` 与标准类型注解组合使用。 8. 注意,这个 *路径操作函数* 使用的是常规的 `def` 而不是 `async def`。 一如既往,在 FastAPI 中你可以按需组合 `def` 和 `async def`。 如果需要回顾何时用哪一个,请查看关于 [`async` 和 `await`](../async.md#in-a-hurry) 的文档中的 _“急不可待?”_ 一节。 9. 这个 *路径操作函数* 返回的不是数据类(当然也可以返回数据类),而是包含内部数据的字典列表。 FastAPI 会使用(包含数据类的)`response_model` 参数来转换响应。
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 3.9K bytes - Click Count (0) -
docs/tr/docs/tutorial/stream-json-lines.md
/// ### Async Olmayan path operation function'lar { #non-async-path-operation-functions } `async` olmadan normal `def` fonksiyonları da kullanabilir ve aynı şekilde `yield` yazabilirsiniz. FastAPI, event loop’u bloklamayacak şekilde doğru çalışmasını garanti eder. Bu durumda fonksiyon async olmadığı için doğru dönüş tipi `Iterable[Item]` olur:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:51:35 GMT 2026 - 4.6K bytes - Click Count (0) -
tests/test_strict_content_type_router_level.py
router_default = APIRouter(prefix="/default") @router_lax.post("/items/") async def router_lax_post(data: dict): return data @router_strict.post("/items/") async def router_strict_post(data: dict): return data @router_default.post("/items/") async def router_default_post(data: dict): return data app.include_router(router_lax)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Feb 23 17:45:20 GMT 2026 - 1.7K bytes - Click Count (0) -
docs_src/app_testing/tutorial002_py310.py
from fastapi import FastAPI from fastapi.testclient import TestClient from fastapi.websockets import WebSocket app = FastAPI() @app.get("/") async def read_main(): return {"msg": "Hello World"} @app.websocket("/ws") async def websocket(websocket: WebSocket): await websocket.accept() await websocket.send_json({"msg": "Hello WebSocket"}) await websocket.close() def test_read_main():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 757 bytes - Click Count (0) -
tests/test_response_model_data_filter.py
name: str owner: UserDB class PetOut(BaseModel): name: str owner: UserBase @app.post("/users/", response_model=UserBase) async def create_user(user: UserCreate): return user @app.get("/pets/{pet_id}", response_model=PetOut) async def read_pet(pet_id: int): user = UserDB( email="******@****.***", hashed_password="secrethashed", )Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 1.7K bytes - Click Count (0)