-
Notifications
You must be signed in to change notification settings - Fork 10
Docs: sync INR, GTQ, JMD account schemas with OpenAPI #661
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,8 +116,14 @@ private fun buildAccountInfo(accountType: String, accountInfo: JsonNode): Extern | |
| "INR_ACCOUNT" -> { | ||
| val info = InrExternalAccountCreateInfo.builder() | ||
| .accountType(InrExternalAccountCreateInfo.AccountType.INR_ACCOUNT) | ||
| .vpa(accountInfo.requireText("vpa")) | ||
| .beneficiary(buildInrBeneficiary(beneficiaryNode)) | ||
| .apply { | ||
| accountInfo.optText("vpa")?.let { vpa(it) } | ||
| accountInfo.optText("accountNumber")?.let { accountNumber(it) } | ||
| accountInfo.optText("ifsc")?.let { ifsc(it) } | ||
| accountInfo.optText("rail")?.let { rail(it) } | ||
| accountInfo.optText("bankName")?.let { bankName(it) } | ||
| } | ||
| .build() | ||
| ExternalAccountCreate.AccountInfo.ofInrAccount(info) | ||
| } | ||
|
Comment on lines
116
to
129
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The OpenAPI schema ( Prompt To Fix With AIThis is a comment left during a code review.
Path: samples/kotlin/src/main/kotlin/com/grid/sample/routes/ExternalAccounts.kt
Line: 116-129
Comment:
**`paymentRails` never forwarded to the INR account builder**
The OpenAPI schema (`InrAccountInfo`) requires `paymentRails` (an array like `["NEFT"]` or `["UPI"]`). The `apply` block maps all five INR account-info fields, but never reads or sets `paymentRails`. Any INR account creation request routed through this sample will omit the required field and receive a validation error from the API. Both the UPI and NEFT/RTGS documentation examples explicitly include `"paymentRails"`, so the Kotlin path should read it from the incoming request body (e.g., `accountInfo.optList("paymentRails")`) and call the corresponding builder method.
How can I resolve this? If you propose a fix, please make it concise. |
||
|
|
||
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.
paymentRailsfield for INR_ACCOUNTcode-generator.ts'sbuildAccountInfoBodypopulates the request body exclusively by iterating overspec.fields(line 47–49). The OpenAPI schema (InrAccountInfo) markspaymentRailsas a required field, but there is nopaymentRailsentry in the fields array here. Every INR account creation call emitted by the Grid Visualizer will therefore be missing that field and fail API validation. A{ name: 'paymentRails', example: '["NEFT"]' }entry (or equivalent special-casing in the code generator) is needed to produce a valid request body.Prompt To Fix With AI