背景
CLAUDE.md には「レスポンスモデルを response_model で明示(Any 返却禁止)」と規定している。
しかし現在の handler はすべて -> JSONResponse を返しており FastAPI の response_model を使っていない。
結果として OpenAPI スキーマにレスポンス型が出力されない。CLAUDE.md ポリシーとコードの乖離。
対応方針
- Pydantic の Response モデル(
XxxResponse 命名)を handler ファイルに定義する
@router.get(..., response_model=XxxResponse) で型を明示する
- Note / Tag / Comment の全ハンドラーに適用
影響範囲
src/example/note/handler.py
src/example/tag/handler.py
src/example/comment/handler.py
背景
CLAUDE.md には「レスポンスモデルを
response_modelで明示(Any 返却禁止)」と規定している。しかし現在の handler はすべて
-> JSONResponseを返しており FastAPI のresponse_modelを使っていない。結果として OpenAPI スキーマにレスポンス型が出力されない。CLAUDE.md ポリシーとコードの乖離。
対応方針
XxxResponse命名)を handler ファイルに定義する@router.get(..., response_model=XxxResponse)で型を明示する影響範囲
src/example/note/handler.pysrc/example/tag/handler.pysrc/example/comment/handler.py