Skip to content

docs(errors): add error type docs and wire type URIs into Problem responses - #124

Draft
glebremniov wants to merge 1 commit into
mainfrom
claude/determined-fermi-8qfqje
Draft

docs(errors): add error type docs and wire type URIs into Problem responses#124
glebremniov wants to merge 1 commit into
mainfrom
claude/determined-fermi-8qfqje

Conversation

@glebremniov

@glebremniov glebremniov commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Created docs/errors/ with one markdown page per RFC 9457 problem type: validation-error, bad-request, unauthorized, not-found, internal-error. Each page documents causes, the exact JSON response shape, and how to fix/recover.
  • Updated Problem.type description with a full lookup table mapping each URI to its HTTP status and meaning.
  • Added examples to every response component in specs/openapi.yaml so Swagger UI and generated clients surface realistic, actionable payloads. BadRequest gets two examples — one for per-field validation (with errors[]) and one for semantic/cross-field errors (no errors[]).

Error types documented

Type URI suffix Status When
validation-error.md 400 Per-field constraint failed; errors[] populated
bad-request.md 400 Semantic / cross-field rule violated (e.g. trend range > 24 months)
unauthorized.md 401 Missing, expired, or untrusted bearer token
not-found.md 404 Resource absent or owned by another user
internal-error.md 500 Unexpected server failure

Test plan

  • pnpm run lint — no errors
  • pnpm run validate — no validation issues
  • Review each docs/errors/*.md page renders correctly on GitHub
  • Check Swagger UI shows the new examples in the response panels

Generated by Claude Code

…ponses

Create docs/errors/ with a markdown page for each RFC 9457 problem type
(validation-error, bad-request, unauthorized, not-found, internal-error).
Each page lists causes, the exact response shape, and remediation steps.

Wire those URLs into the spec: update Problem.type description with a full
lookup table, and add concrete examples on every response component
(BadRequest gets two — one for field validation, one for semantic errors)
so generated clients and Swagger UI surface realistic, actionable payloads.

https://claude.ai/code/session_01JMRt4bgmjxSE7UT2MypBo6
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants