Skip to content

fix(codegen): implement type-driven form encoding across SDKs - #1674

Merged
drstrangelooker merged 4 commits into
mainfrom
fix-form-body
Mar 25, 2026
Merged

drstrangelooker merged 4 commits into
mainfrom
fix-form-body

Conversation

@popmonkey

Copy link
Copy Markdown
Contributor

Transition from explicitly assigning Content-Type headers inside generated methods to using native language Wrapper Types (e.g. URLSearchParams, FormValues) that the Runtime Library automatically deserializes for application/x-www-form-urlencoded behaviors.

Fixes #1673

Transition from explicitly assigning Content-Type headers inside generated
methods to using native language Wrapper Types (e.g. URLSearchParams, FormValues)
that the Runtime Library automatically deserializes for
application/x-www-form-urlencoded behaviors.

Fixes #1673
@popmonkey
popmonkey requested a review from a team as a code owner March 25, 2026 05:21
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 refactors how application/x-www-form-urlencoded requests are handled across various SDKs. Instead of manually setting Content-Type headers, the system now uses native language-specific wrapper types (like FormValues in C# and Swift, Values in Go, and URLSearchParams in Python and TypeScript). This change allows the runtime libraries to automatically detect and correctly serialize form-encoded data, leading to more robust, maintainable, and idiomatic SDK code.

Highlights

  • Type-Driven Form Encoding: Implemented a new mechanism for application/x-www-form-urlencoded requests, transitioning from explicit Content-Type header assignment to using native language wrapper types.
  • C# SDK Enhancements: Introduced a FormValues class in the C# runtime library and updated the transport layer to automatically handle its serialization for form-urlencoded content.
  • Go SDK Integration: Added a Values type alias in the Go runtime and modified the Do method to recognize and serialize this type as application/x-www-form-urlencoded.
  • Python SDK Refinement: Introduced a URLSearchParams class in the Python runtime and updated API methods to automatically set the Content-Type header and serialize this type for form-urlencoded requests.
  • Swift SDK Adaptation: Added a FormValues struct in the Swift runtime and updated the transport layer to handle its encoding for form-urlencoded requests.
  • TypeScript SDK Support: Implemented assignFormArgs to use URLSearchParams for type-driven form encoding.
  • Kotlin SDK Integration: Modified assignFormArgs to wrap form-encoded bodies with an encodeValues function.
  • Codegen Updates: The SDK code generator was updated across multiple languages (C#, Go, Kotlin, Python, Swift, TypeScript) to leverage the new type-driven form encoding logic, ensuring consistent behavior.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@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 comprehensive support for application/x-www-form-urlencoded content type across various SDK languages including C#, Go, Python, Swift, and TypeScript. This involves adding new types (e.g., FormValues, URLSearchParams) and updating the serialization logic in the runtime libraries to correctly encode form data. The code generation process has also been adjusted to accommodate these new form-encoding mechanisms. A review comment points out a potential issue in the TypeScript baseTransport where non-primitive values within form data might be incorrectly serialized as [object Object], suggesting an improvement for handling complex objects.

Comment thread packages/sdk-rtl/src/baseTransport.ts Outdated
@github-actions

github-actions Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Go Tests

  5 files    5 suites   1m 53s ⏱️
 50 tests  50 ✅ 0 💤 0 ❌
110 runs  110 ✅ 0 💤 0 ❌

Results for commit 9c0e762.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Python Tests

  9 files    9 suites   1m 4s ⏱️
144 tests 139 ✅  5 💤 0 ❌
768 runs  747 ✅ 21 💤 0 ❌

Results for commit 9c0e762.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Codegen Tests

442 tests   403 ✅  38s ⏱️
 19 suites   39 💤
  1 files      0 ❌

Results for commit 9c0e762.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Typescript Tests

  2 files   56 suites   1m 2s ⏱️
209 tests 207 ✅ 2 💤 0 ❌
446 runs  442 ✅ 4 💤 0 ❌

Results for commit 9c0e762.

♻️ This comment has been updated with latest results.

* explicitly JSON.stringify nested properties and arrays during form-encoding
* directly parse dates down to .toISOString() and .isoformat() to keep uniform
  timezone and formatting integrity over the wire
* added jest assertion in browserTransport tests
@drstrangelooker
drstrangelooker merged commit 58aaf86 into main Mar 25, 2026
44 checks passed
@drstrangelooker
drstrangelooker deleted the fix-form-body branch March 25, 2026 13:21
drstrangelooker pushed a commit that referenced this pull request Mar 25, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>@looker/api-explorer: 0.9.85</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/code-editor bumped from 0.1.51 to 0.1.52
    * @looker/extension-utils bumped from 0.1.61 to 0.1.62
    * @looker/run-it bumped from 0.9.84 to 0.9.85
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-codegen bumped from 21.11.1 to 21.11.2
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
  * devDependencies
    * @looker/sdk-codegen-scripts bumped from 21.5.41 to 21.5.42
    * @looker/sdk-node bumped from 26.6.0 to 26.6.1
</details>

<details><summary>@looker/code-editor: 0.1.52</summary>

### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @looker/sdk-codegen bumped from 21.11.1 to 21.11.2
</details>

<details><summary>@looker/extension-api-explorer: 22.21.42</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/api-explorer bumped from 0.9.84 to 0.9.85
    * @looker/extension-sdk bumped from 26.6.0 to 26.6.1
    * @looker/extension-sdk-react bumped from 26.6.0 to 26.6.1
    * @looker/extension-utils bumped from 0.1.61 to 0.1.62
    * @looker/run-it bumped from 0.9.84 to 0.9.85
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-codegen bumped from 21.11.1 to 21.11.2
</details>

<details><summary>@looker/extension-playground: 1.0.42</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/extension-sdk bumped from 26.6.0 to 26.6.1
    * @looker/extension-sdk-react bumped from 26.6.0 to 26.6.1
    * @looker/sdk bumped from 26.6.0 to 26.6.1
</details>

<details><summary>@looker/extension-tile-playground: 1.1.29</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/extension-sdk bumped from 26.6.0 to 26.6.1
    * @looker/extension-sdk-react bumped from 26.6.0 to 26.6.1
    * @looker/sdk bumped from 26.6.0 to 26.6.1
</details>

<details><summary>@looker/extension-utils: 0.1.62</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/code-editor bumped from 0.1.51 to 0.1.52
    * @looker/extension-sdk bumped from 26.6.0 to 26.6.1
    * @looker/extension-sdk-react bumped from 26.6.0 to 26.6.1
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
</details>

<details><summary>@looker/hackathon: 22.21.44</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/code-editor bumped from 0.1.51 to 0.1.52
    * @looker/extension-sdk bumped from 26.6.0 to 26.6.1
    * @looker/extension-sdk-react bumped from 26.6.0 to 26.6.1
    * @looker/extension-utils bumped from 0.1.61 to 0.1.62
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
    * @looker/wholly-artifact bumped from 0.1.42 to 0.1.43
</details>

<details><summary>@looker/run-it: 0.9.85</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/code-editor bumped from 0.1.51 to 0.1.52
    * @looker/extension-utils bumped from 0.1.61 to 0.1.62
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-codegen bumped from 21.11.1 to 21.11.2
    * @looker/sdk-codegen-utils bumped from 21.0.31 to 21.0.32
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
</details>

<details><summary>sdk-codegen: 21.11.2</summary>

##
[21.11.2](sdk-codegen-v21.11.1...sdk-codegen-v21.11.2)
(2026-03-25)


### Bug Fixes

* **codegen:** implement type-driven form encoding across SDKs
([#1674](#1674))
([58aaf86](58aaf86)),
closes
[#1673](#1673)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
  * devDependencies
    * @looker/sdk-codegen-utils bumped from 21.0.31 to 21.0.32
</details>

<details><summary>@looker/sdk-codegen-scripts: 21.5.42</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-codegen bumped from 21.11.1 to 21.11.2
    * @looker/sdk-codegen-utils bumped from 21.0.31 to 21.0.32
    * @looker/sdk-node bumped from 26.6.0 to 26.6.1
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
</details>

<details><summary>@looker/sdk-codegen-utils: 21.0.32</summary>

### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-node bumped from 26.6.0 to 26.6.1
</details>

<details><summary>sdk-rtl: 21.6.5</summary>

##
[21.6.5](sdk-rtl-v21.6.4...sdk-rtl-v21.6.5)
(2026-03-25)


### Bug Fixes

* **codegen:** implement type-driven form encoding across SDKs
([#1674](#1674))
([58aaf86](58aaf86)),
closes
[#1673](#1673)
</details>

<details><summary>@looker/wholly-artifact: 0.1.43</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
    * @looker/sdk bumped from 26.6.0 to 26.6.1
  * devDependencies
    * @looker/sdk-node bumped from 26.6.0 to 26.6.1
</details>

<details><summary>@looker/wholly-sheet: 0.5.81</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
  * devDependencies
    * @looker/sdk-node bumped from 26.6.0 to 26.6.1
</details>

<details><summary>sdk-codegen-all: 26.6.1</summary>

##
[26.6.1](sdk-codegen-all-v26.6.0...sdk-codegen-all-v26.6.1)
(2026-03-25)


### Features

* generate SDKs for Looker 26.6.1
([#1676](#1676))
([b48b953](b48b953))


### Bug Fixes

* **codegen:** implement type-driven form encoding across SDKs
([#1674](#1674))
([58aaf86](58aaf86)),
closes
[#1673](#1673)
</details>

<details><summary>looker_sdk: 26.6.1</summary>

##
[26.6.1](looker_sdk-v26.6.0...looker_sdk-v26.6.1)
(2026-03-25)


### Features

* generate SDKs for Looker 26.6.1
([#1676](#1676))
([b48b953](b48b953))


### Bug Fixes

* **codegen:** implement type-driven form encoding across SDKs
([#1674](#1674))
([58aaf86](58aaf86)),
closes
[#1673](#1673)
</details>

<details><summary>embed-components: 26.6.1</summary>

##
[26.6.1](embed-components-v26.6.0...embed-components-v26.6.1)
(2026-03-25)


### Miscellaneous Chores

* **embed-components:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/embed-services bumped from 26.6.0 to 26.6.1
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
  * devDependencies
    * @looker/sdk-node bumped from 26.6.0 to 26.6.1
</details>

<details><summary>embed-services: 26.6.1</summary>

##
[26.6.1](embed-services-v26.6.0...embed-services-v26.6.1)
(2026-03-25)


### Miscellaneous Chores

* **embed-services:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
    * @looker/sdk bumped from 26.6.0 to 26.6.1
  * devDependencies
    * @looker/sdk-node bumped from 26.6.0 to 26.6.1
</details>

<details><summary>extension-sdk: 26.6.1</summary>

##
[26.6.1](extension-sdk-v26.6.0...extension-sdk-v26.6.1)
(2026-03-25)


### Miscellaneous Chores

* **extension-sdk:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
</details>

<details><summary>extension-sdk-react: 26.6.1</summary>

##
[26.6.1](extension-sdk-react-v26.6.0...extension-sdk-react-v26.6.1)
(2026-03-25)


### Miscellaneous Chores

* **extension-sdk-react:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/extension-sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
</details>

<details><summary>sdk: 26.6.1</summary>

##
[26.6.1](sdk-v26.6.0...sdk-v26.6.1)
(2026-03-25)


### Features

* generate SDKs for Looker 26.6.1
([#1676](#1676))
([b48b953](b48b953))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
</details>

<details><summary>sdk-node: 26.6.1</summary>

##
[26.6.1](sdk-node-v26.6.0...sdk-node-v26.6.1)
(2026-03-25)


### Miscellaneous Chores

* **sdk-node:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @looker/sdk bumped from 26.6.0 to 26.6.1
    * @looker/sdk-rtl bumped from 21.6.4 to 21.6.5
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Bug: form handling submits hash in body, should submit url encoded params

2 participants