Skip to content

Optional query params and code format #1513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 17, 2025
Merged

Optional query params and code format #1513

merged 13 commits into from
Jun 17, 2025

Conversation

gcatanese
Copy link
Contributor

Regenerate services after template update

@gcatanese gcatanese requested a review from a team as a code owner June 17, 2025 07:00
Copy link
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.

Summary of Changes

Hello @gcatanese, 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 updating the generated TypeScript service client code. The primary goal was to regenerate services after a template update, which has resulted in significant code formatting changes and a simplification of how ObjectSerializer methods are called. It also includes minor adjustments to API type definitions and their associated documentation.

Highlights

  • Code Generation Update: The service client code has been regenerated, leading to widespread updates across API and typings files. This is a standard process following template updates.
  • Simplified ObjectSerializer Usage: The ObjectSerializer.serialize and ObjectSerializer.deserialize methods across various service typings (e.g., balanceControl, binLookup, dataProtection, disputes, legalEntityManagement, payment, paymentsApp, payout, posMobile, recurring, sessionAuthentication) now have their format parameter default to an empty string. This allows call sites in the API service files to omit the "" argument, making the code cleaner and more concise.
  • API Template Enhancement: The core API generation template (templates-v7/typescript/api/api.mustache) has been updated to correctly mark optional query parameters with a ? in method signatures, improving type safety and clarity for generated API clients.
  • API Definition Refinements: Several API type definitions have been updated, including adding kycOnInvite to various TermsOfService related enums, refining JSDoc comments for fields like postalCode and financialReport.currencyOfFinancialData, and changing string literal quotes from single to double in many Payout-related typings files for consistency.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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
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 primarily involves changes resulting from a template update, as indicated by the description "Regenerate services after template update". Key improvements include:

  1. Optional format parameter in ObjectSerializer: The serialize and deserialize methods in various ObjectSerializer.ts files now have their format parameter as optional with a default empty string. This is a good enhancement, simplifying calls to these methods when no specific format is needed.
  2. Cleaner Serializer Calls: Consequently, numerous API service files have been updated to remove the redundant empty string argument in ObjectSerializer.serialize and ObjectSerializer.deserialize calls, leading to cleaner code.
  3. Improved Optional Query Parameter Handling: The api.mustache template has been updated to make query parameters optional in generated method signatures only if they are not marked as required in the OpenAPI specification. This improves the correctness of the generated SDK.
  4. Type Definition Updates: Various typings have been updated, including enum additions (e.g., KycOnInvite), documentation clarifications, and stylistic formatting changes (like consistent use of double quotes for property names in src/typings/payout/ files, aligning with the "code format" aspect of the PR title).

The main point requiring attention is a potentially breaking change in src/typings/legalEntityManagement/financialReport.ts, where the dateOfFinancialData field has become mandatory. This needs to be confirmed.

Overall, the changes appear to enhance code quality and correctness, assuming the API contract changes (like new enum values and the mandatory field) are intended. No specific style guide was provided, so feedback is based on general TypeScript best practices.

Copy link

@gcatanese gcatanese merged commit d86971c into main Jun 17, 2025
7 checks passed
@gcatanese gcatanese deleted the optional-query-params branch June 17, 2025 07:36
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