fix: use proto default values in generated a2a_types.ts#303
Conversation
🧪 Code CoverageNo coverage changes. Generated by coverage-comment.yml |
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 refines the handling of optional fields within 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. 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
|
There was a problem hiding this comment.
Code Review
This pull request effectively standardizes the handling of optional fields in the generated a2a_types and converters, aligning the codebase with Protobuf standards. The changes are consistent and well-executed.
- The generated types in
a2a_types.tsnow correctly use default values for scalar types (e.g.,''for strings,0for numbers,falsefor booleans) instead ofundefined, and thefromJSON/toJSONmethods have been updated accordingly. - The
ToProtoconverter now correctly mapsundefinedvalues in the domain model to empty strings for the Protobuf layer. - The
FromProtoconverter correctly maps empty strings from the Protobuf layer back toundefinedfor the internal domain model, maintaining existing semantics. - The addition of
bufconfiguration files is a great improvement for managing Protobuf definitions.
The changes are thorough and improve the consistency and correctness of the type conversions. I have no further comments.
🤖 I have created a release *beep* *boop* --- ## [0.3.9](v0.3.8...v0.3.9) (2026-01-21) ### Features * implement gRPC client ([#299](#299)) ([dbdb96e](dbdb96e)) * implement gRPC server ([#279](#279)) ([bd4caa2](bd4caa2)) ### Bug Fixes * use proto default values in generated a2a_types.ts ([#303](#303)) ([0215d42](0215d42)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
This PR standardizes the handling of optional fields in the generated a2a_types and converters. It aligns the codebase with Protobuf standards by replacing undefined checks with empty string checks for missing string values.
Key Changes
Generated Types (a2a_types.ts):
Converters:
Motivation
These changes ensure consistency with the Protobuf specification, where missing strings must default to the empty string rather than undefined.