- Sort Score
- Num 10 results
- Language All
Results 1 - 6 of 6 for ResponseMessage (0.09 seconds)
-
docs_src/generate_clients/tutorial001_py310.py
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: float class ResponseMessage(BaseModel): message: str @app.post("/items/", response_model=ResponseMessage) async def create_item(item: Item): return {"message": "item received"} @app.get("/items/", response_model=list[Item]) async def get_items(): return [
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 494 bytes - Click Count (0) -
docs_src/generate_clients/tutorial002_py310.py
from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: float class ResponseMessage(BaseModel): message: str class User(BaseModel): username: str email: str @app.post("/items/", response_model=ResponseMessage, tags=["items"]) async def create_item(item: Item): return {"message": "Item received"}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 730 bytes - Click Count (0) -
docs/en/docs/advanced/generate-clients.md
{* ../../docs_src/generate_clients/tutorial001_py310.py hl[7:9,12:13,16:17,21] *} Notice that the *path operations* define the models they use for request payload and response payload, using the models `Item` and `ResponseMessage`. ### API Docs { #api-docs } If you go to `/docs`, you will see that it has the **schemas** for the data to be sent in requests and received in responses: <img src="/img/tutorial/generate-clients/image01.png">Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 9.7K bytes - Click Count (1) -
docs/zh/docs/advanced/generate-clients.md
## 创建一个 TypeScript SDK { #create-a-typescript-sdk } 先从一个简单的 FastAPI 应用开始: {* ../../docs_src/generate_clients/tutorial001_py310.py hl[7:9,12:13,16:17,21] *} 请注意,这些*路径操作*使用 `Item` 和 `ResponseMessage` 模型来定义它们的请求载荷和响应载荷。 ### API 文档 { #api-docs } 访问 `/docs` 时,你会看到有用于请求发送和响应接收数据的**模式**: <img src="/img/tutorial/generate-clients/image01.png"> 之所以能看到这些模式,是因为它们在应用中用模型声明了。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 8.9K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/generate-clients.md
## 建立 TypeScript SDK { #create-a-typescript-sdk } 先從一個簡單的 FastAPI 應用開始: {* ../../docs_src/generate_clients/tutorial001_py310.py hl[7:9,12:13,16:17,21] *} 注意這些 *路徑操作* 為請求與回應的有效載荷定義了所用的模型,使用了 `Item` 與 `ResponseMessage` 這兩個模型。 ### API 文件 { #api-docs } 如果你前往 `/docs`,你會看到其中包含了請求要送出的資料與回應接收的資料之**結構(schemas)**: <img src="/img/tutorial/generate-clients/image01.png"> 你之所以能看到這些結構,是因為它們在應用內以模型宣告了。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 9.1K bytes - Click Count (0) -
docs_src/generate_clients/tutorial003_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 914 bytes - Click Count (0)