fix: use application/json Content-Type for HTTP+JSON error responses#769
fix: use application/json Content-Type for HTTP+JSON error responses#769jmesnil wants to merge 3 commits intoa2aproject:mainfrom
Conversation
The spec is not explicit on that but the error responses should all use `application/json`. * in JSON-RPC, an error response is a regular JSON-RPC response * in HTTP+JSON, the error payload was moved from RFC 9457 to AIP-193 so the RFC-9457's `application/problem+json` no longer makes sense. This fixes a2aproject#768
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request standardizes the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request standardizes the Content-Type for error responses across JSON-RPC and REST transports to application/json, removing the APPLICATION_PROBLEM_JSON media type. This involves updating MediaType.java, removing related imports, modifying Content-Type headers in error handling logic, and adjusting corresponding test assertions. The review feedback highlights an opportunity to improve maintainability by replacing hardcoded "application/json" strings with the APPLICATION_JSON constant in test files, specifically in A2AServerRoutesTest.java and RestHandlerTest.java.
reference/rest/src/test/java/io/a2a/server/rest/quarkus/A2AServerRoutesTest.java
Outdated
Show resolved
Hide resolved
transport/rest/src/test/java/io/a2a/transport/rest/handler/RestHandlerTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jeff Mesnil <jmesnil@ibm.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request standardizes the content type for all JSON responses to application/json, removing the distinction previously made with application/problem+json. This change involves removing the APPLICATION_PROBLEM_JSON constant from io.a2a.common.MediaType, updating A2AServerRoutes and RestHandler to consistently use APPLICATION_JSON for both success and error responses, and refactoring associated test files to reflect these new content type expectations. Minor code style and Javadoc updates were also included.
The spec is not explicit on that but the error responses should all use
application/json.application/problem+jsonno longer makes sense.This fixes #768