-
Notifications
You must be signed in to change notification settings - Fork 73
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
Conversation
There was a problem hiding this 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
andObjectSerializer.deserialize
methods across various service typings (e.g.,balanceControl
,binLookup
,dataProtection
,disputes
,legalEntityManagement
,payment
,paymentsApp
,payout
,posMobile
,recurring
,sessionAuthentication
) now have theirformat
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 variousTermsOfService
related enums, refining JSDoc comments for fields likepostalCode
andfinancialReport.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
-
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. ↩
There was a problem hiding this 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:
- Optional
format
parameter inObjectSerializer
: Theserialize
anddeserialize
methods in variousObjectSerializer.ts
files now have theirformat
parameter as optional with a default empty string. This is a good enhancement, simplifying calls to these methods when no specific format is needed. - Cleaner Serializer Calls: Consequently, numerous API service files have been updated to remove the redundant empty string argument in
ObjectSerializer.serialize
andObjectSerializer.deserialize
calls, leading to cleaner code. - 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 asrequired
in the OpenAPI specification. This improves the correctness of the generated SDK. - 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 insrc/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.
|
Regenerate services after template update