chore: Update external account schemas from webdev#146
chore: Update external account schemas from webdev#146lightspark-copybara[bot] wants to merge 1 commit intomainfrom
Conversation
Greptile OverviewGreptile SummaryThis PR adds two new external account info schema components ( Main items to double-check before merging are naming consistency ( Confidence Score: 4/5
|
| 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
| required: | ||
| - accountType | ||
| - beneficiary | ||
| - clabe | ||
| - name |
There was a problem hiding this 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.
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.| beneficiary: | ||
| oneOf: | ||
| - $ref: ./IndividualBeneficiary.yaml | ||
| - $ref: ./BusinessBeneficiary.yaml | ||
| discriminator: | ||
| propertyName: beneficiaryType | ||
| mapping: | ||
| INDIVIDUAL: ./IndividualBeneficiary.yaml | ||
| BUSINESS: ./BusinessBeneficiary.yaml |
There was a problem hiding this 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.
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.
Auto-synced external account schemas from webdev.
These schemas are generated from VASP adapter field definitions in sparkcore.
Please review the changes before merging.