chore: Update external account schemas from webdev#160
chore: Update external account schemas from webdev#160lightspark-copybara[bot] wants to merge 1 commit intomainfrom
Conversation
Greptile OverviewGreptile SummaryAuto-synced schemas add support for INR (Indian Rupee) and MXN (Mexican Peso) external accounts with their respective payment rails (UPI and SPEI). However, the generated schemas deviate from the established architectural pattern used by all other external account types in this codebase. Key Issues
Expected PatternThe schemas should follow this structure: allOf:
- $ref: ./BaseExternalAccountInfo.yaml
- $ref: ../common/[Currency]AccountInfo.yaml
- type: object
required:
- beneficiary
properties:
beneficiary:
$ref: ./BeneficiaryOneOf.yamlThese inconsistencies will likely cause schema validation issues and break the discriminator-based polymorphism used throughout the API. Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/external_accounts/InrAccountInfo.yaml | New INR account schema added with UPI payment rail, but doesn't follow existing architecture pattern (should use allOf with common schemas) and missing from ExternalAccountType enum |
| openapi/components/schemas/external_accounts/MxnAccountInfo.yaml | New MXN account schema added with SPEI payment rail, but doesn't follow existing architecture pattern (should use allOf with common schemas) and missing from ExternalAccountType enum |
| openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml | Added INR and MXN account types to oneOf union and discriminator mapping, indentation formatting changed from 2 spaces to consistent YAML style |
Sequence Diagram
sequenceDiagram
participant Dev as Webdev Repo
participant Bot as Copybara Bot
participant Schemas as External Account Schemas
participant OneOf as ExternalAccountInfoOneOf
participant Enum as ExternalAccountType
Dev->>Bot: Generate INR & MXN schemas from VASP adapter
Bot->>Schemas: Create InrAccountInfo.yaml
Bot->>Schemas: Create MxnAccountInfo.yaml
Bot->>OneOf: Add INR & MXN to oneOf union
Bot->>OneOf: Add discriminator mappings
Note over Enum: ⚠️ Missing: INR_ACCOUNT & MXN_ACCOUNT not added to enum
Note over Schemas: ⚠️ Issue: Schemas don't use allOf pattern
Note over Schemas: ⚠️ Issue: Inline beneficiary instead of BeneficiaryOneOf ref
| type: object | ||
| title: INR Account | ||
| description: 'Required fields for USD -> INR corridor. Supported payment rails: Upi.' | ||
| required: | ||
| - accountType | ||
| - vpa | ||
| - beneficiary | ||
| properties: | ||
| accountType: | ||
| type: string | ||
| enum: | ||
| - INR_ACCOUNT | ||
| example: INR_ACCOUNT | ||
| payment_rails: | ||
| type: array | ||
| items: | ||
| type: string | ||
| const: | ||
| - Upi | ||
| description: Supported payment rails for this currency. Auto-populated based on | ||
| account type. | ||
| receivingCurrency: | ||
| type: string | ||
| const: INR | ||
| description: Receiving currency code. Auto-populated based on account type. | ||
| vpa: | ||
| type: string | ||
| description: The VPA of the bank | ||
| beneficiary: | ||
| type: object | ||
| required: | ||
| - birthDate | ||
| - fullName | ||
| - nationality | ||
| properties: | ||
| fullName: | ||
| type: string | ||
| description: The full name of the beneficiary | ||
| birthDate: | ||
| type: string | ||
| description: The birth date of the beneficiary | ||
| nationality: | ||
| type: string | ||
| description: The nationality of the beneficiary | ||
| email: | ||
| type: string | ||
| description: The email of the beneficiary | ||
| phoneNumber: | ||
| type: string | ||
| description: The phone number of the beneficiary | ||
| registrationNumber: | ||
| type: string | ||
| description: The registration number of the beneficiary | ||
| countryOfResidence: | ||
| type: string | ||
| description: The country of residence of the beneficiary | ||
| address: | ||
| type: string | ||
| description: The address of the beneficiary |
There was a problem hiding this comment.
Schema doesn't follow the existing architecture pattern used by other account types. Compare with UpiAccountExternalAccountInfo.yaml (lines 1-9) which uses allOf to compose BaseExternalAccountInfo.yaml, common/UpiAccountInfo.yaml, and adds beneficiary requirements. This schema duplicates the VPA field definition instead of referencing the common schema.
Also missing INR_ACCOUNT from ExternalAccountType.yaml enum and BaseExternalAccountInfo.yaml discriminator mapping.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/InrAccountInfo.yaml
Line: 1:59
Comment:
Schema doesn't follow the existing architecture pattern used by other account types. Compare with `UpiAccountExternalAccountInfo.yaml` (lines 1-9) which uses `allOf` to compose `BaseExternalAccountInfo.yaml`, `common/UpiAccountInfo.yaml`, and adds beneficiary requirements. This schema duplicates the VPA field definition instead of referencing the common schema.
Also missing `INR_ACCOUNT` from `ExternalAccountType.yaml` enum and `BaseExternalAccountInfo.yaml` discriminator mapping.
How can I resolve this? If you propose a fix, please make it concise.| type: object | ||
| title: MXN Account | ||
| description: 'Required fields for USD -> MXN corridor. Supported payment rails: Spei.' | ||
| required: | ||
| - accountType | ||
| - clabeNumber | ||
| - beneficiary | ||
| properties: | ||
| accountType: | ||
| type: string | ||
| enum: | ||
| - MXN_ACCOUNT | ||
| example: MXN_ACCOUNT | ||
| payment_rails: | ||
| type: array | ||
| items: | ||
| type: string | ||
| const: | ||
| - Spei | ||
| description: Supported payment rails for this currency. Auto-populated based on | ||
| account type. | ||
| receivingCurrency: | ||
| type: string | ||
| const: MXN | ||
| description: Receiving currency code. Auto-populated based on account type. | ||
| clabeNumber: | ||
| type: string | ||
| description: The CLABE number of the bank | ||
| example: '123456789012345678' | ||
| minLength: 18 | ||
| maxLength: 18 | ||
| pattern: ^[0-9]{18}$ | ||
| beneficiary: | ||
| type: object | ||
| required: | ||
| - fullName | ||
| properties: | ||
| fullName: | ||
| type: string | ||
| description: The full name of the beneficiary | ||
| birthDate: | ||
| type: string | ||
| description: The birth date of the beneficiary | ||
| nationality: | ||
| type: string | ||
| description: The nationality of the beneficiary | ||
| email: | ||
| type: string | ||
| description: The email of the beneficiary | ||
| phoneNumber: | ||
| type: string | ||
| description: The phone number of the beneficiary | ||
| registrationNumber: | ||
| type: string | ||
| description: The registration number of the beneficiary | ||
| countryOfResidence: | ||
| type: string | ||
| description: The country of residence of the beneficiary | ||
| address: | ||
| type: string | ||
| description: The address of the beneficiary |
There was a problem hiding this comment.
Schema doesn't follow the existing architecture pattern used by other account types. Compare with ClabeAccountExternalAccountInfo.yaml (lines 1-9) which uses allOf to compose BaseExternalAccountInfo.yaml, common/ClabeAccountInfo.yaml, and adds beneficiary requirements. This schema duplicates the CLABE field definition instead of referencing the common schema.
Also missing MXN_ACCOUNT from ExternalAccountType.yaml enum and BaseExternalAccountInfo.yaml discriminator mapping.
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/MxnAccountInfo.yaml
Line: 1:61
Comment:
Schema doesn't follow the existing architecture pattern used by other account types. Compare with `ClabeAccountExternalAccountInfo.yaml` (lines 1-9) which uses `allOf` to compose `BaseExternalAccountInfo.yaml`, `common/ClabeAccountInfo.yaml`, and adds beneficiary requirements. This schema duplicates the CLABE field definition instead of referencing the common schema.
Also missing `MXN_ACCOUNT` from `ExternalAccountType.yaml` enum and `BaseExternalAccountInfo.yaml` discriminator mapping.
<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.| beneficiary: | ||
| type: object | ||
| required: | ||
| - birthDate | ||
| - fullName | ||
| - nationality | ||
| properties: | ||
| fullName: | ||
| type: string | ||
| description: The full name of the beneficiary | ||
| birthDate: | ||
| type: string | ||
| description: The birth date of the beneficiary | ||
| nationality: | ||
| type: string | ||
| description: The nationality of the beneficiary | ||
| email: | ||
| type: string | ||
| description: The email of the beneficiary | ||
| phoneNumber: | ||
| type: string | ||
| description: The phone number of the beneficiary | ||
| registrationNumber: | ||
| type: string | ||
| description: The registration number of the beneficiary | ||
| countryOfResidence: | ||
| type: string | ||
| description: The country of residence of the beneficiary | ||
| address: | ||
| type: string | ||
| description: The address of the beneficiary |
There was a problem hiding this comment.
Beneficiary structure is inconsistent with existing pattern. Other external account types (e.g., ClabeAccountExternalAccountInfo.yaml:8, UpiAccountExternalAccountInfo.yaml:8) reference BeneficiaryOneOf.yaml which provides proper discriminator-based typing between INDIVIDUAL and BUSINESS beneficiaries with beneficiaryType property.
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/InrAccountInfo.yaml
Line: 29:59
Comment:
Beneficiary structure is inconsistent with existing pattern. Other external account types (e.g., `ClabeAccountExternalAccountInfo.yaml:8`, `UpiAccountExternalAccountInfo.yaml:8`) reference `BeneficiaryOneOf.yaml` which provides proper discriminator-based typing between `INDIVIDUAL` and `BUSINESS` beneficiaries with `beneficiaryType` property.
<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.| beneficiary: | ||
| type: object | ||
| required: | ||
| - fullName | ||
| properties: | ||
| fullName: | ||
| type: string | ||
| description: The full name of the beneficiary | ||
| birthDate: | ||
| type: string | ||
| description: The birth date of the beneficiary | ||
| nationality: | ||
| type: string | ||
| description: The nationality of the beneficiary | ||
| email: | ||
| type: string | ||
| description: The email of the beneficiary | ||
| phoneNumber: | ||
| type: string | ||
| description: The phone number of the beneficiary | ||
| registrationNumber: | ||
| type: string | ||
| description: The registration number of the beneficiary | ||
| countryOfResidence: | ||
| type: string | ||
| description: The country of residence of the beneficiary | ||
| address: | ||
| type: string | ||
| description: The address of the beneficiary |
There was a problem hiding this comment.
Beneficiary structure is inconsistent with existing pattern. Other external account types (e.g., ClabeAccountExternalAccountInfo.yaml:8, UpiAccountExternalAccountInfo.yaml:8) reference BeneficiaryOneOf.yaml which provides proper discriminator-based typing between INDIVIDUAL and BUSINESS beneficiaries with beneficiaryType property.
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/MxnAccountInfo.yaml
Line: 33:61
Comment:
Beneficiary structure is inconsistent with existing pattern. Other external account types (e.g., `ClabeAccountExternalAccountInfo.yaml:8`, `UpiAccountExternalAccountInfo.yaml:8`) reference `BeneficiaryOneOf.yaml` which provides proper discriminator-based typing between `INDIVIDUAL` and `BUSINESS` beneficiaries with `beneficiaryType` property.
<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.