Repository navigation
fix(server): send REST errors as application/json - #455
Merged
muscariello merged 1 commit intoNov 2, 2026
Merged
muscariello merged 1 commit into
muscariello merged 1 commit into
Conversation
rest_error_response labelled its google.rpc.Status body application/problem+json, after the spec's worked examples. The Go and .NET clients read an error body only from application/json (Go also from application/a2a+json), so against this server they lost the ErrorInfo reason and mapped the error from the HTTP status alone. The body is not an RFC 9457 problem document either. Errors now use axum's default application/json; success responses stay application/a2a+json. Fixes: #454 Signed-off-by: Luca Muscariello <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
msardara
approved these changes
Nov 2, 2026
Merged
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.
Fixes #454. Stacked on #441: review only the last commit.
Cause:
rest_error_responselabelled itsgoogle.rpc.Statuserror bodyapplication/problem+json. The Go and .NET clients read an error body only fromapplication/json(Go also fromapplication/a2a+json), so against this server they lost theErrorInforeason: Go readTASK_NOT_FOUNDasErrMethodNotFound, .NET readTASK_NOT_CANCELABLEasInvalidRequest.Fix: errors use axum's default
application/json; successes stayapplication/a2a+json. a2aproject/A2A#1689 proposes the same for the spec.Placement: below #443 on purpose. The version errors (#443), stream errors (#449) and rejections (#451) are all built on the final media type, so none of them changes it later. #449 and #451 were adjusted to follow: the error function #449 refactors and one assertion in #451's test.
Tests: the content-type test is renamed and asserts
application/json. The Go v2.7.0 and a2a-dotnet clients were also run against the example server before and after: typed errors come back only after.Unproven: the Python client was not checked.