Browse Source

📝 Add return type annotations to path params tutorial example

pull/15690/head
kotoYoshi 1 week ago
parent
commit
1f8589b4ac
  1. 4
      docs_src/path_params/tutorial003_py310.py

4
docs_src/path_params/tutorial003_py310.py

@ -4,10 +4,10 @@ app = FastAPI()
@app.get("/users/me")
async def read_user_me():
async def read_user_me() -> dict:
return {"user_id": "the current user"}
@app.get("/users/{user_id}")
async def read_user(user_id: str):
async def read_user(user_id: str) -> dict:
return {"user_id": user_id}

Loading…
Cancel
Save