feat(sidekick/swift): non-string maps#6361
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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.
chingor13
approved these changes
Jun 10, 2026
nolanleastin
approved these changes
Jun 10, 2026
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>
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.
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