Skip to content

feat: PydanticのRequestValidationErrorをRFC 9457 Problem Details形式に変換#71

Merged
hideyukiMORI merged 1 commit into
mainfrom
feat/issue-66-pydantic-422-problem-details
May 19, 2026
Merged

feat: PydanticのRequestValidationErrorをRFC 9457 Problem Details形式に変換#71
hideyukiMORI merged 1 commit into
mainfrom
feat/issue-66-pydantic-422-problem-details

Conversation

@hideyukiMORI
Copy link
Copy Markdown
Owner

Summary

  • request_validation_error_handler()nene2.middleware.error_handler に追加
  • FastAPIのデフォルト {"detail": [...]} 形式の代わりに nene2 Problem Details 形式(validation-failed)を返す
  • src/example/app.py にハンドラを登録
  • docs/how-to/new-project.md のサンプルコードにも登録例を追加
  • テスト2件追加(フォーマット確認 + フィールド名抽出確認)

Closes #66

Test plan

  • uv run pytest — 167 passed, 91.77% coverage
  • uv run ruff check src/ tests/ — All checks passed
  • uv run ruff format --check src/ tests/ — Already formatted
  • uv run mypy src/ — No issues

🤖 Generated with Claude Code

…ハンドラを追加

Closes #66

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hideyukiMORI hideyukiMORI merged commit b964110 into main May 19, 2026
@hideyukiMORI hideyukiMORI deleted the feat/issue-66-pydantic-422-problem-details branch May 19, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: FastAPI RequestValidationError を nene2 Problem Details 形式に変換 (FT1-F7)

1 participant