Skip to content

feat: add problemFor(raw) to preserve the observed HTTP status - #50

Merged
hseshadr merged 1 commit into
mainfrom
feat/problem-for
Oct 25, 2026
Merged

hseshadr merged 1 commit into
mainfrom
feat/problem-for

Conversation

@hseshadr

Copy link
Copy Markdown
Collaborator

Fixes the multi-status loss: a code with httpStatus: [400, 422] now emits the 422 that actually matched when the caller uses problemFor(raw). Additive; toProblemDetails is unchanged. 346 tests pass.

classify() returns only the code, so a code registering [400, 422] made
toProblemDetails() emit 400 even when the failure was a 422. problemFor()
classifies and serializes in one step, using the status that matched;
options.status still overrides. Additive API, tested.

Fixes the multi-status loss identified in the review.
@hseshadr
hseshadr merged commit 31ac34d into main Oct 25, 2026
4 of 5 checks passed
@hseshadr
hseshadr deleted the feat/problem-for branch October 25, 2026 15:43
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.

1 participant