Skip to content

new SDK POC - DO NOT MERGE#1649

Closed
popmonkey wants to merge 2 commits intomainfrom
post-forms-new-sdk
Closed

new SDK POC - DO NOT MERGE#1649
popmonkey wants to merge 2 commits intomainfrom
post-forms-new-sdk

Conversation

@popmonkey
Copy link
Copy Markdown
Contributor

This PR is for review only

Transitions query parameters to the body for endpoints consuming application/x-www-form-urlencoded, and normalizes /login in OpenAPI spec.
Executed 'yarn gen' against Looker 26.2
@popmonkey popmonkey requested a review from a team as a code owner March 4, 2026 18:39
@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 focuses on enhancing the robustness and accuracy of the SDKs by standardizing the handling of application/x-www-form-urlencoded requests and correcting an HTTP method. It introduces a new mechanism in the code generator to properly map query parameters to the request body for form-encoded endpoints, specifically addressing the login method across multiple language SDKs. Additionally, it updates the update_self_service_explore_certification endpoint to use the semantically correct PATCH HTTP verb and includes a specification normalization step to maintain backward compatibility for critical login parameters.

Highlights

  • Standardized Form-Encoded Request Handling: Introduced a new isFormUrlEncoded property in the SDK codegen to correctly identify and process application/x-www-form-urlencoded requests, ensuring query parameters are properly sent as the request body for such methods across various SDKs (C#, Go, Kotlin, Python, Swift, TypeScript).
  • Corrected login Method Parameter Order: Adjusted the parameter order for the login method in C#, Go, TypeScript, and Swift SDKs to align with the new form-urlencoded request handling, ensuring client_id and client_secret are passed correctly.
  • Updated update_self_service_explore_certification HTTP Method: Changed the HTTP verb for the update_self_service_explore_certification endpoint from POST to PATCH across all affected SDKs (C#, Go, TypeScript, Swift) and their documentation, reflecting a more accurate semantic operation.
  • Enhanced OpenAPI Specification Normalization: Implemented a normalizeLogin function in the SDK spec converter to automatically re-inject client_id and client_secret parameters and define the requestBody as form-urlencoded for the /login endpoint, ensuring backward compatibility and correct code generation even if these details are missing from the raw OpenAPI spec.

🧠 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.

Changelog
  • csharp/sdk/4.0/methods.cs
    • Reordered parameters in the login method's AuthRequest call.
    • Changed HTTP method from POST to PATCH for update_self_service_explore_certification and updated its documentation.
  • go/sdk/v4/methods.go
    • Reordered parameters in the Login method's AuthSession.Do call.
    • Changed HTTP method from POST to PATCH for UpdateSelfServiceExploreCertification and updated its documentation.
  • packages/sdk-codegen/src/codeGen.ts
    • Modified httpArgs to handle isFormUrlEncoded methods by treating query parameters as the body.
  • packages/sdk-codegen/src/csharp.gen.ts
    • Updated httpArgs logic to account for isFormUrlEncoded methods.
  • packages/sdk-codegen/src/go.gen.ts
    • Updated httpArgs logic to account for isFormUrlEncoded methods.
  • packages/sdk-codegen/src/kotlin.gen.ts
    • Updated httpArgs logic to account for isFormUrlEncoded methods.
  • packages/sdk-codegen/src/python.gen.ts
    • Updated httpArgs logic to account for isFormUrlEncoded methods, moving query parameters to the body for form-encoded requests.
  • packages/sdk-codegen/src/sdkModels.spec.ts
    • Added new test cases for isFormUrlEncoded property on login and user methods.
  • packages/sdk-codegen/src/sdkModels.ts
    • Added isFormUrlEncoded property to IMethod interface and Method class.
    • Modified Method constructor to conditionally add body parameters based on isFormUrlEncoded.
  • packages/sdk-codegen/src/specConverter.spec.ts
    • Imported upgradeSpecObject.
    • Added test cases for normalizeLogin in upgradeSpecObject to ensure client_id and client_secret are present for the /login endpoint.
  • packages/sdk-codegen/src/specConverter.ts
    • Added normalizeLogin function to inject client_id and client_secret parameters and a form-urlencoded requestBody for the /login endpoint if missing.
    • Integrated normalizeLogin into upgradeSpecObject for both OpenAPI and Swagger conversions.
  • packages/sdk-codegen/src/swift.gen.ts
    • Updated httpArgs logic to account for isFormUrlEncoded methods.
  • packages/sdk-codegen/src/typescript.gen.ts
    • Updated httpArgs logic to account for isFormUrlEncoded methods.
  • packages/sdk/src/4.0/funcs.ts
    • Reordered parameters in the login function's sdk.post call.
    • Changed HTTP method from POST to PATCH for update_self_service_explore_certification and updated its documentation.
  • packages/sdk/src/4.0/methods.ts
    • Reordered parameters in the login method's this.post call.
    • Changed HTTP method from POST to PATCH for update_self_service_explore_certification and updated its documentation.
  • packages/sdk/src/4.0/methodsInterface.ts
    • Updated documentation for update_self_service_explore_certification to reflect PATCH method.
  • packages/sdk/src/4.0/models.ts
    • Added /* eslint-disable @typescript-eslint/ban-types */ comment.
  • packages/sdk/src/4.0/streams.ts
    • Reordered parameters in the login method's this.post call.
    • Changed HTTP method from POST to PATCH for update_self_service_explore_certification and updated its documentation.
  • swift/looker/sdk/methods.swift
    • Reordered parameters in the login method's self.post call.
    • Changed HTTP method from POST to PATCH for update_self_service_explore_certification and updated its documentation.
  • swift/looker/sdk/streams.swift
    • Reordered parameters in the login method's self.post call.
    • Changed HTTP method from POST to PATCH for update_self_service_explore_certification and updated its documentation.
Activity
  • The pull request is marked as 'DO NOT MERGE' and 'for review only', indicating it is a proof-of-concept or work-in-progress.
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.

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

  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.

Copy link
Copy Markdown
Contributor

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

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 significant changes to how form-urlencoded requests are handled across various SDKs (C#, Go, TypeScript, Swift). The core logic in the SDK codegen has been updated to correctly identify and process application/x-www-form-urlencoded methods, specifically for the /login endpoint. This involves a new isFormUrlEncoded property and logic to move query parameters into the request body for such methods. Additionally, the HTTP method for the /self_service_models/{model_name}/certification endpoint has been corrected from POST to PATCH in both documentation and method calls across the SDKs. New tests have been added to validate the isFormUrlEncoded functionality and the normalizeLogin process, which ensures backward compatibility for the /login endpoint by injecting client_id and client_secret parameters if missing. The changes appear to be well-implemented and consistent across the different language SDKs, addressing functional correctness and API specification alignment.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Go Tests

  6 files  ±0    6 suites  ±0   2m 36s ⏱️ +20s
 50 tests ±0   50 ✅ ±0  0 💤 ±0  0 ❌ ±0 
120 runs  ±0  120 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 15686d2. ± Comparison against base commit e83b964.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Codegen Tests

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

Results for commit 15686d2.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Typescript Tests

  2 files   56 suites   1m 4s ⏱️
208 tests 206 ✅ 2 💤 0 ❌
444 runs  440 ✅ 4 💤 0 ❌

Results for commit 15686d2.

@popmonkey popmonkey closed this Mar 6, 2026
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.

1 participant