Skip to content

chore: Update external account schemas from webdev#146

Open
lightspark-copybara[bot] wants to merge 1 commit intomainfrom
auto/sync-external-accounts-20260204-185536
Open

chore: Update external account schemas from webdev#146
lightspark-copybara[bot] wants to merge 1 commit intomainfrom
auto/sync-external-accounts-20260204-185536

Conversation

@lightspark-copybara
Copy link

Auto-synced external account schemas from webdev.

These schemas are generated from VASP adapter field definitions in sparkcore.

Please review the changes before merging.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

This PR adds two new external account info schema components (InrUpiAccountInfo and MxnSpeiAccountInfo) generated from upstream VASP adapter field definitions, introducing required fields for USD→INR (UPI) and USD→MXN (SPEI) corridors, including a polymorphic beneficiary using a discriminator.

Main items to double-check before merging are naming consistency (name vs existing fullName/legalName) and avoiding duplication of the existing BeneficiaryOneOf schema block to reduce drift.

Confidence Score: 4/5

  • This PR is safe to merge with minor schema consistency concerns.
  • Changes are additive (two new schema files) and follow existing beneficiary discriminator patterns; the main risk is client confusion from inconsistent field naming and duplicated oneOf/discriminator blocks that could drift from the canonical Beneficiary schema.
  • openapi/components/schemas/external_accounts/MxnSpeiAccountInfo.yaml

Important Files Changed

Filename Overview
openapi/components/schemas/external_accounts/InrUpiAccountInfo.yaml Adds new INR UPI external account info schema with accountType, fullName, vpa, and beneficiary discriminator; structure matches existing beneficiary pattern but duplicates BeneficiaryOneOf block.
openapi/components/schemas/external_accounts/MxnSpeiAccountInfo.yaml Adds new MXN SPEI external account info schema with clabe, name, and beneficiary discriminator; name field is inconsistent with existing fullName/legalName naming and repeats BeneficiaryOneOf mapping.

Sequence Diagram

sequenceDiagram
  participant Client
  participant API as Grid API
  participant OA as OpenAPI Schemas

  Client->>OA: Read ExternalAccount schema
  OA-->>Client: oneOf accountInfo includes InrUpiAccountInfo / MxnSpeiAccountInfo
  Client->>API: Create external account (corridor USD->INR via UPI or USD->MXN via SPEI)
  API->>API: Validate required fields (accountType, beneficiary, + vpa/fullName or clabe/name)
  API-->>Client: 201 Created or validation error
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +4 to +8
required:
- accountType
- beneficiary
- clabe
- name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] required uses name, but other beneficiary schemas already use fullName/legalName, and INR UPI uses fullName. If the intent is “payee name”, this inconsistency can be confusing for clients and may cause generated SDKs to expose multiple overlapping fields.

Consider aligning on an existing field name (e.g. fullName) or clarifying in the description why name is distinct from beneficiary.fullName/beneficiary.legalName.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/MxnSpeiAccountInfo.yaml
Line: 4:8

Comment:
[P2] `required` uses `name`, but other beneficiary schemas already use `fullName`/`legalName`, and INR UPI uses `fullName`. If the intent is “payee name”, this inconsistency can be confusing for clients and may cause generated SDKs to expose multiple overlapping fields.

Consider aligning on an existing field name (e.g. `fullName`) or clarifying in the description why `name` is distinct from `beneficiary.fullName`/`beneficiary.legalName`.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +23 to +31
beneficiary:
oneOf:
- $ref: ./IndividualBeneficiary.yaml
- $ref: ./BusinessBeneficiary.yaml
discriminator:
propertyName: beneficiaryType
mapping:
INDIVIDUAL: ./IndividualBeneficiary.yaml
BUSINESS: ./BusinessBeneficiary.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] This schema duplicates the existing BeneficiaryOneOf.yaml discriminator/oneOf block. To reduce drift (e.g., mapping changes), consider referencing it directly ($ref: ./BeneficiaryOneOf.yaml) instead of repeating the structure.

Also appears in: openapi/components/schemas/external_accounts/InrUpiAccountInfo.yaml:23-31.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/MxnSpeiAccountInfo.yaml
Line: 23:31

Comment:
[P3] This schema duplicates the existing `BeneficiaryOneOf.yaml` discriminator/oneOf block. To reduce drift (e.g., mapping changes), consider referencing it directly (`$ref: ./BeneficiaryOneOf.yaml`) instead of repeating the structure.

Also appears in: `openapi/components/schemas/external_accounts/InrUpiAccountInfo.yaml:23-31`.

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

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.

0 participants