fix!: use ProtoJSON for REST transport#292
Conversation
Summary of ChangesHello @guglielmo-san, 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 significantly updates the data handling within the REST transport layer by migrating to Protocol Buffer generated types. This change aims to enhance data consistency and interoperability across the system by enforcing a structured data format for all API interactions. The implementation includes comprehensive conversion mechanisms to ensure compatibility between the existing application logic and the new protobuf structures. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🧪 Code Coverage
Generated by coverage-comment.yml |
There was a problem hiding this comment.
Code Review
This pull request is a significant and well-executed refactoring to adopt Protobuf-generated types for the REST transport layer. This is a great improvement for type safety and consistency across the client and server. The changes are comprehensive, touching the client transport, server handler, and updating tests accordingly. I've identified a few minor issues, including a potential runtime error from a missing type cast, a duplicated test assertion, a method name typo, and an incorrect path in a build script. Overall, this is a high-quality contribution.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request successfully refactors the REST transport to use Protobuf-generated types, which is a significant improvement for ensuring payload compatibility with other A2A SDKs. The introduction of ToProto and FromProto utility classes is a good design choice for centralizing the conversion logic. The changes are consistently applied across both client and server implementations, and the tests have been largely updated to reflect this.
I've identified a few areas for improvement, mainly concerning test correctness and a small opportunity for code deduplication to enhance maintainability. My specific comments are detailed below.
…ation and deserialization
# Description Bring back TCK capabilities tests for REST and use [0.3.0.beta3](https://github.com/a2aproject/a2a-tck/releases/tag/0.3.0.beta3) tag, both work now after #292.
🤖 I have created a release *beep* *boop* --- ## [0.3.8](v0.3.7...v0.3.8) (2026-01-15) ### ⚠ BREAKING CHANGES * use ProtoJSON for REST transport ([#292](#292)) ### Features * use case-insensitive transport protocol name comparison in ClientFactory ([5246067](5246067)) ### Bug Fixes * add typesVersions to support legacy module resolution ([#288](#288)) ([6499e29](6499e29)) * use ProtoJSON for REST transport ([#292](#292)) ([d2efc4c](d2efc4c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…2aproject#352) Apparently the code removed in a2aproject#346 wasn't "dead", this method wasn't properly migrated in a2aproject#292. Tests are updated to cover this. Fixes a2aproject#336
Description
This PR resolves an incompatibility in the payload shape between the REST Transport handlers and other A2A SDKs.
In this version, the transmitted payload now aligns with the field names and structure defined in the proto file. A new
a2a.tsfile has been introduced to represent the proto types, including their correspondingfromJsonandtoJsonconversion functions.Technically this is a breaking change, however current implementation isn't compatible with other official SDKs, so fixing in-place. Current situation with JSON format for HTTP+JSON is complicated as there is no explicit specification in 0.3, see here for more details.
Fixes #291 🦕
Release-As: 0.3.8