Skip to content

chore: Update external account schemas from webdev#148

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

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

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

Auto-synced two new external account schemas (MxnSpeiAccountInfo and InrUpiAccountInfo) from webdev VASP adapter definitions, adding support for Mexican SPEI and Indian UPI payment corridors.

Critical Issues:

  • Both new schemas (MxnSpeiAccountInfo.yaml and InrUpiAccountInfo.yaml) don't follow the established architectural patterns used by all other external account schemas
  • Missing required updates to ExternalAccountType.yaml enum (needs MXN_SPEI_ACCOUNT and INR_UPI_ACCOUNT values)
  • Missing required updates to BaseExternalAccountInfo.yaml discriminator mappings
  • New schemas use inline beneficiary definitions instead of referencing BeneficiaryOneOf.yaml
  • New schemas missing the allOf composition pattern with BaseExternalAccountInfo
  • Field naming inconsistencies: clabe should be clabeNumber to match existing ClabeAccountInfo.yaml

Recommended Actions:

  • Restructure both new schemas to use allOf pattern with base schemas
  • Create corresponding common schemas in openapi/components/schemas/common/
  • Add new account type enum values to ExternalAccountType.yaml
  • Update discriminator mappings in BaseExternalAccountInfo.yaml
  • Use BeneficiaryOneOf reference for beneficiary fields

Confidence Score: 2/5

  • This PR has critical schema inconsistencies that will cause validation failures and API client errors
  • The new schemas don't follow established patterns and are missing required enum/discriminator updates in related files, which will break OpenAPI validation and client code generation
  • Both MxnSpeiAccountInfo.yaml and InrUpiAccountInfo.yaml need complete restructuring. Additionally, ExternalAccountType.yaml and BaseExternalAccountInfo.yaml need updates but aren't included in this PR.

Important Files Changed

Filename Overview
openapi/components/schemas/external_accounts/MxnSpeiAccountInfo.yaml New MXN SPEI account schema with inconsistent field naming (clabe vs clabeNumber), inline beneficiary definition instead of using BeneficiaryOneOf, and missing allOf pattern
openapi/components/schemas/external_accounts/InrUpiAccountInfo.yaml New INR UPI account schema with inconsistent field naming (fullName vs per-field), inline beneficiary definition instead of using BeneficiaryOneOf, and missing allOf pattern
openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml Added two new account types with discriminator mappings; formatting changed from 2-space to no-space indent for list items

Sequence Diagram

sequenceDiagram
    participant Webdev as Webdev/Sparkcore
    participant PR as PR #148
    participant GridAPI as Grid API OpenAPI
    participant Client as API Clients

    Webdev->>PR: Auto-sync external account schemas
    Note over PR: Add MxnSpeiAccountInfo.yaml<br/>Add InrUpiAccountInfo.yaml<br/>Update ExternalAccountInfoOneOf.yaml
    
    PR->>GridAPI: ExternalAccountInfoOneOf references new schemas
    Note over GridAPI: ⚠️ Missing BaseExternalAccountInfo update<br/>⚠️ Missing ExternalAccountType enum update
    
    alt If merged without fixes
        Client->>GridAPI: Request with MXN_SPEI_ACCOUNT type
        GridAPI-->>Client: ❌ Validation error (unknown type)
    else If properly updated
        Client->>GridAPI: Request with MXN_SPEI_ACCOUNT type
        GridAPI->>GridAPI: Validate against schema
        GridAPI-->>Client: ✅ Success
    end
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.

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +1 to +31
type: object
title: MxnSpeiAccountInfo
description: Required fields for USD -> MXN corridor via Spei
required:
- accountType
- beneficiary
- clabe
- name
properties:
accountType:
type: string
enum:
- MXN_SPEI_ACCOUNT
example: MXN_SPEI_ACCOUNT
clabe:
type: string
description: Mexican CLABE interbank account number (18 digits)
example: 012180001234567890
name:
type: string
description: Full name of the payee
example: Jane Smith
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.

Schema structure doesn't follow existing patterns. All other external account schemas use allOf with BaseExternalAccountInfo and a common schema ref (see ClabeAccountExternalAccountInfo.yaml, UpiAccountExternalAccountInfo.yaml). This schema should:

  1. Use allOf pattern with BaseExternalAccountInfo.yaml
  2. Reference a common MxnSpeiAccountInfo.yaml schema
  3. Use $ref: ./BeneficiaryOneOf.yaml for beneficiary instead of inline definition
  4. Field clabe should be clabeNumber (matches existing ClabeAccountInfo.yaml)

Expected structure:

allOf:
  - $ref: ./BaseExternalAccountInfo.yaml
  - $ref: ../common/MxnSpeiAccountInfo.yaml
  - type: object
    required:
      - beneficiary
    properties:
      beneficiary:
        $ref: ./BeneficiaryOneOf.yaml

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: 1:31

Comment:
Schema structure doesn't follow existing patterns. All other external account schemas use `allOf` with `BaseExternalAccountInfo` and a common schema ref (see `ClabeAccountExternalAccountInfo.yaml`, `UpiAccountExternalAccountInfo.yaml`). This schema should:

1. Use `allOf` pattern with `BaseExternalAccountInfo.yaml`
2. Reference a common `MxnSpeiAccountInfo.yaml` schema
3. Use `$ref: ./BeneficiaryOneOf.yaml` for beneficiary instead of inline definition
4. Field `clabe` should be `clabeNumber` (matches existing `ClabeAccountInfo.yaml`)

Expected structure:
```yaml
allOf:
  - $ref: ./BaseExternalAccountInfo.yaml
  - $ref: ../common/MxnSpeiAccountInfo.yaml
  - type: object
    required:
      - beneficiary
    properties:
      beneficiary:
        $ref: ./BeneficiaryOneOf.yaml
```

<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.

Comment on lines +1 to +31
type: object
title: InrUpiAccountInfo
description: Required fields for USD -> INR corridor via Upi
required:
- accountType
- beneficiary
- fullName
- vpa
properties:
accountType:
type: string
enum:
- INR_UPI_ACCOUNT
example: INR_UPI_ACCOUNT
fullName:
type: string
description: Full name of the beneficiary
example: John Michael Doe
vpa:
type: string
description: Virtual Payment Address (UPI)
example: john@upi
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.

Schema structure doesn't follow existing patterns. All other external account schemas use allOf with BaseExternalAccountInfo and a common schema ref (see UpiAccountExternalAccountInfo.yaml). This schema should:

  1. Use allOf pattern with BaseExternalAccountInfo.yaml
  2. Reference a common InrUpiAccountInfo.yaml schema in ../common/
  3. Use $ref: ./BeneficiaryOneOf.yaml for beneficiary instead of inline definition
  4. fullName should not be duplicated in both top-level and beneficiary (beneficiary already has this field)

Expected structure:

allOf:
  - $ref: ./BaseExternalAccountInfo.yaml
  - $ref: ../common/InrUpiAccountInfo.yaml
  - type: object
    required:
      - beneficiary
    properties:
      beneficiary:
        $ref: ./BeneficiaryOneOf.yaml

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/InrUpiAccountInfo.yaml
Line: 1:31

Comment:
Schema structure doesn't follow existing patterns. All other external account schemas use `allOf` with `BaseExternalAccountInfo` and a common schema ref (see `UpiAccountExternalAccountInfo.yaml`). This schema should:

1. Use `allOf` pattern with `BaseExternalAccountInfo.yaml`
2. Reference a common `InrUpiAccountInfo.yaml` schema in `../common/`
3. Use `$ref: ./BeneficiaryOneOf.yaml` for beneficiary instead of inline definition
4. `fullName` should not be duplicated in both top-level and beneficiary (beneficiary already has this field)

Expected structure:
```yaml
allOf:
  - $ref: ./BaseExternalAccountInfo.yaml
  - $ref: ../common/InrUpiAccountInfo.yaml
  - type: object
    required:
      - beneficiary
    properties:
      beneficiary:
        $ref: ./BeneficiaryOneOf.yaml
```

<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.

Comment on lines +34 to +37
- title: MxnSpeiAccountInfo
$ref: ./MxnSpeiAccountInfo.yaml
- title: InrUpiAccountInfo
$ref: ./InrUpiAccountInfo.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing updates to related schemas. Adding MXN_SPEI_ACCOUNT and INR_UPI_ACCOUNT types requires updates to:

  1. ExternalAccountType.yaml - add enum values
  2. BaseExternalAccountInfo.yaml - add discriminator mappings

Without these updates, the new account types won't be recognized as valid values.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 34:37

Comment:
Missing updates to related schemas. Adding `MXN_SPEI_ACCOUNT` and `INR_UPI_ACCOUNT` types requires updates to:

1. `ExternalAccountType.yaml` - add enum values
2. `BaseExternalAccountInfo.yaml` - add discriminator mappings

Without these updates, the new account types won't be recognized as valid values.

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