Repository navigation
feat(sidekick/swift): generate synthetic messages - #6530
Conversation
For discovery-based APIs the generator produces structs corresponding to the synthetic request messages. To avoid name clashes,these structs are generated in extensions to the client struct.
There was a problem hiding this comment.
Code Review
This pull request introduces support for discovery-based APIs in the Swift generator by handling service placeholder messages. It updates message annotations, type name resolution, and file generation to output placeholder-specific Swift files using a new template. Comprehensive tests are also added to verify these changes. The review feedback suggests simplifying a redundant boolean comparison in generate.go and optimizing test file content searches by using the bytes package instead of converting byte slices to strings.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for discovery-based APIs in the Swift generator by handling service placeholders. It adds a PlaceholderName to message annotations, updates the message type name resolution for service placeholders, and modifies the generation logic to output placeholder files (+Requests.swift) using new Mustache templates. Additionally, comprehensive unit tests have been added to verify message annotation and file generation for discovery services. I have no feedback to provide.
For discovery-based APIs the generator produces structs corresponding to the synthetic request messages. To avoid name clashes,these structs are generated in extensions to the client struct.
🤖 I have created a release *beep* *boop* --- ## [0.23.0](v0.22.0...v0.23.0) (2026-06-29) ### Features * **internal/librarian/java:** add decamelize utility for README generation ([#6538](#6538)) ([a6d950a](a6d950a)), closes [#6515](#6515) * **internal/librarian/java:** Add JSpecify dep to proto module template ([#6564](#6564)) ([660ab2b](660ab2b)) * **internal/librarian/java:** add production sample filter ([#6545](#6545)) ([df213ec](df213ec)), closes [#6515](#6515) * **internal/librarian/java:** add README sample extraction helpers ([#6574](#6574)) ([500ba22](500ba22)), closes [#6515](#6515) * **internal/librarian/java:** add title override extractor ([#6546](#6546)) ([0986d6a](0986d6a)), closes [#6515](#6515) * **internal/librarian/python:** update gapic-generator to 1.36.0 ([#6548](#6548)) ([a0930f4](a0930f4)) * **nodejs:** bump pnpm version to 11.7.0 and support v11+ global bin layout ([#6494](#6494)) ([1373628](1373628)), closes [#6480](#6480) * **sidekick/rust:** track recording error info for discovery LROs ([#6304](#6304)) ([feb2ef2](feb2ef2)), closes [#6286](#6286) * **sidekick/swift:** generate synthetic messages ([#6530](#6530)) ([7303648](7303648)) * **sidekick/swift:** handle clashing names ([#6543](#6543)) ([56bf365](56bf365)) * **sidekick/swift:** swap client vs. protocol ([#6566](#6566)) ([14e186c](14e186c)) ### Bug Fixes * **internal/librarian:** gracefully handle nil defaults in applyDefaults ([#6571](#6571)) ([3ee938a](3ee938a)) --- 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>
For discovery-based APIs the generator produces structs corresponding to the synthetic request messages. To avoid name clashes,these structs are generated in extensions to the client struct.
Fixes #6492