FastAPI は ASGI 上で動作するため、リクエストは非同期パイプラインを通過します。ASGI サーバーがリクエストを受け取り、middleware がそれをラップし、router が path をマッチさせ、依存関係が解決され、あなたの path operation が実行され、戻り値が response にシリアライズされます。
ステージ
lua
uvicorn (ASGI server)
│ scope + receive/send
▼
ASGI / Starlette middleware ── (CORS, GZip, custom)
▼
Routing ── method + をマッチ → operation
▼
Dependencies (Depends) ── -deps の解決, security, -setup
▼
Path operation 