Skip to content

feat(sidekick/swift): non-string maps#6361

Merged
coryan merged 2 commits into
googleapis:mainfrom
coryan:feat-support-non-string-maps
Jun 10, 2026
Merged

feat(sidekick/swift): non-string maps#6361
coryan merged 2 commits into
googleapis:mainfrom
coryan:feat-support-non-string-maps

Conversation

@coryan

@coryan coryan commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Protobuf can define maps where the key is not a string. These require custom serialization and deserialization. It may be possible to reduce the size of the generated code, but I cannot find a way at the moment.

Fixes #5808

Protobuf can define maps where the key is not a string. These require custom
serialization and deserialization. It may be possible to reduce the size of the
generated code, but I cannot find a way at the moment.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for map fields in the Swift sidekick generator, including custom serialization for non-string-keyed maps. The review feedback identifies two critical Swift compilation issues in the mustache template: first, lazy.map cannot be used with a throwing closure, and second, shorthand tuple arguments $0 and $1 are invalid when mapping over a dictionary, requiring explicit tuple decomposition instead.

Comment thread internal/sidekick/swift/templates/common/message.mustache
Comment thread internal/sidekick/swift/templates/common/message.mustache
@coryan coryan marked this pull request as ready for review June 10, 2026 13:38
@coryan coryan requested a review from a team as a code owner June 10, 2026 13:39
Comment thread internal/sidekick/swift/annotate_message.go
Comment thread internal/sidekick/swift/templates/common/message.mustache
@coryan coryan enabled auto-merge (squash) June 10, 2026 17:37
@coryan coryan merged commit 2b6d7e4 into googleapis:main Jun 10, 2026
30 checks passed
@coryan coryan deleted the feat-support-non-string-maps branch June 10, 2026 17:38
jskeet pushed a commit that referenced this pull request Jun 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.20.0](v0.19.0...v0.20.0)
(2026-06-10)


### Features

* **nodejs:** add a DefaultVersion field to NodeJSPackage
([#6358](#6358))
([af3218f](af3218f))
* **sidekick/rust:** add bigquery code gen
([#6322](#6322))
([a7846f5](a7846f5))
* **sidekick/swift:** non-string maps
([#6361](#6361))
([2b6d7e4](2b6d7e4))
* **sidekick/swift:** support discovery-based modules
([#6351](#6351))
([09ef5cf](09ef5cf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sidekick: swift supports maps with non-string keys

3 participants