Repository navigation
fix(http): refuse malformed requests as an ApiError - #173
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
A request whose path, query or JSON body axum's extractors refused got axum's plain-text rejection, not the ApiError every other failure is, so clients couldn't read why. The routes now extract through Path, Query and Json wrappers whose rejection is an HttpError: a client error is a bad_request ApiError, and a route that doesn't match its handler an internal one, logged.
PiquelChips
force-pushed
the
fix/hold-whole-seconds-in-a-period
branch
from
November 22, 2026 20:22
9ca64c3 to
c1a7051
Compare
PiquelChips
force-pushed
the
fix/refuse-malformed-requests-as-an-apierror
branch
from
November 22, 2026 20:22
705515a to
72b9471
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When axum's
Path,QueryorJsonextractors refused a request, for a malformed query or body, the client got axum's plain-text rejection, not theApiErrorevery other failure returns, so the SDK couldn't say why. The routes now extract throughPath,QueryandJsonwrappers, declared by a small macro, whose rejection is anHttpError. A client error comes back as abad_requestApiError. A route that doesn't match its handler, which is a server bug, comes back as an internal error and is logged. The wrappers keep axum's names, so the OpenAPI document doesn't change. A new HTTP test sends a malformed query and a malformed body and expects a 400ApiErrorfor each. It addsreqwestas a dev-dependency of origin-src, since the SDK never sends such requests.Part of #166.
Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)