Skip to content

fix: handler の response_model を統一して CLAUDE.md ポリシーに準拠させる #539

@hideyukiMORI

Description

@hideyukiMORI

背景

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions