Conversation
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript ✅ grid-python studio · code
✅ grid-typescript studio · code
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile OverviewGreptile SummaryThis PR implements a major restructuring of external account schemas, transitioning from generic account types to currency-specific schemas. The sync adds 10 new currencies (BRL, DKK, HKD, IDR, INR, MXN, MYR, THB, USD, VND) with dedicated account info and beneficiary schemas. Key changes:
Breaking API change: Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/external_accounts/ExternalAccountType.yaml | Removed 7 account types (US_ACCOUNT, CLABE, PIX, IBAN, UPI, NGN_ACCOUNT, CAD_ACCOUNT) and added 10 new currency-specific types (BRL, DKK, HKD, IDR, INR, MXN, MYR, THB, USD, VND). This is a breaking change. |
| openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml | Replaced account type references to align with new currency-specific external account schema files. Updated discriminator mapping to reference new files. |
| openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml | Updated discriminator mapping to reflect new currency-specific external account files and removed mappings for deprecated account types. |
| .stainless/stainless.yml | Updated reference from NgnAccountExternalAccountInfo to NgnExternalAccountInfo, but this file doesn't exist in the schema, indicating a potential configuration error. |
| openapi/components/schemas/common/BrlAccountInfo.yaml | New schema for Brazilian Real account info with PIX key, PIX key type, and tax ID fields. Well-structured. |
| openapi/components/schemas/external_accounts/BrlExternalAccountInfo.yaml | New external account schema for BRL that combines BaseExternalAccountInfo, BrlAccountInfo, and adds currency-specific beneficiary with oneOf discriminator for INDIVIDUAL/BUSINESS types. |
| openapi/components/schemas/common/UsdAccountInfo.yaml | New schema for USD account info with routing number and account number. Replaces UsAccountInfo for external accounts. |
| openapi/components/schemas/external_accounts/UsdExternalAccountInfo.yaml | New external account schema for USD replacing US_ACCOUNT. Follows same structure as other currency-specific external accounts with oneOf beneficiary discriminator. |
Sequence Diagram
sequenceDiagram
participant Client
participant API
participant Schema Validator
participant Currency Schema
Client->>API: Create External Account Request
API->>Schema Validator: Validate accountType
Schema Validator->>Schema Validator: Check ExternalAccountType enum
alt Currency-Specific Account (BRL, DKK, HKD, etc.)
Schema Validator->>Currency Schema: Validate with {Currency}ExternalAccountInfo
Currency Schema->>Currency Schema: Validate {Currency}AccountInfo (account fields)
Currency Schema->>Currency Schema: Validate beneficiary (oneOf INDIVIDUAL/BUSINESS)
Currency Schema-->>Schema Validator: Schema valid
else Legacy Account Type (US_ACCOUNT, CLABE, PIX, etc.)
Schema Validator-->>API: ERROR: Account type no longer supported
end
Schema Validator-->>API: Validation result
API-->>Client: Response
Last reviewed commit: f78067f
| oneOf: | ||
| - title: US Account | ||
| $ref: ./UsAccountExternalAccountInfo.yaml | ||
| - title: CLABE Account | ||
| $ref: ./ClabeAccountExternalAccountInfo.yaml | ||
| - title: PIX Account | ||
| $ref: ./PixAccountExternalAccountInfo.yaml | ||
| - title: IBAN Account | ||
| $ref: ./IbanAccountExternalAccountInfo.yaml | ||
| - title: UPI Account | ||
| $ref: ./UpiAccountExternalAccountInfo.yaml | ||
| - title: NGN Account | ||
| $ref: ./NgnAccountExternalAccountInfo.yaml | ||
| - title: CAD Account | ||
| $ref: ./CadAccountExternalAccountInfo.yaml | ||
| - title: GBP Account | ||
| $ref: ./GbpAccountExternalAccountInfo.yaml | ||
| - title: PHP Account | ||
| $ref: ./PhpAccountExternalAccountInfo.yaml | ||
| - title: SGD Account | ||
| $ref: ./SgdAccountExternalAccountInfo.yaml | ||
| - title: Spark Wallet | ||
| $ref: ./SparkWalletExternalAccountInfo.yaml | ||
| - title: Lightning | ||
| $ref: ./LightningExternalAccountInfo.yaml | ||
| - title: Solana Wallet | ||
| $ref: ./SolanaWalletExternalAccountInfo.yaml | ||
| - title: Tron Wallet | ||
| $ref: ./TronWalletExternalAccountInfo.yaml | ||
| - title: Polygon Wallet | ||
| $ref: ./PolygonWalletExternalAccountInfo.yaml | ||
| - title: Base Wallet | ||
| $ref: ./BaseWalletExternalAccountInfo.yaml | ||
| - title: US Account | ||
| $ref: ./UsAccountExternalAccountInfo.yaml | ||
| - title: CLABE Account | ||
| $ref: ./ClabeAccountExternalAccountInfo.yaml | ||
| - title: PIX Account | ||
| $ref: ./PixAccountExternalAccountInfo.yaml | ||
| - title: IBAN Account | ||
| $ref: ./IbanAccountExternalAccountInfo.yaml | ||
| - title: UPI Account | ||
| $ref: ./UpiAccountExternalAccountInfo.yaml | ||
| - title: NGN Account | ||
| $ref: ./NgnAccountExternalAccountInfo.yaml | ||
| - title: CAD Account | ||
| $ref: ./CadAccountExternalAccountInfo.yaml | ||
| - title: GBP Account | ||
| $ref: ./GbpAccountExternalAccountInfo.yaml | ||
| - title: PHP Account | ||
| $ref: ./PhpAccountExternalAccountInfo.yaml | ||
| - title: SGD Account | ||
| $ref: ./SgdAccountExternalAccountInfo.yaml | ||
| - title: Spark Wallet | ||
| $ref: ./SparkWalletExternalAccountInfo.yaml | ||
| - title: Lightning | ||
| $ref: ./LightningExternalAccountInfo.yaml | ||
| - title: Solana Wallet | ||
| $ref: ./SolanaWalletExternalAccountInfo.yaml | ||
| - title: Tron Wallet | ||
| $ref: ./TronWalletExternalAccountInfo.yaml | ||
| - title: Polygon Wallet | ||
| $ref: ./PolygonWalletExternalAccountInfo.yaml | ||
| - title: Base Wallet | ||
| $ref: ./BaseWalletExternalAccountInfo.yaml | ||
| - title: Brl Account | ||
| $ref: ./BrlExternalAccountInfo.yaml | ||
| - title: Cad Account | ||
| $ref: ./CadExternalAccountInfo.yaml | ||
| - title: Clabe Account | ||
| $ref: ./ClabeExternalAccountInfo.yaml | ||
| - title: Dkk Account | ||
| $ref: ./DkkExternalAccountInfo.yaml | ||
| - title: Gbp Account | ||
| $ref: ./GbpExternalAccountInfo.yaml | ||
| - title: Hkd Account | ||
| $ref: ./HkdExternalAccountInfo.yaml | ||
| - title: Iban Account | ||
| $ref: ./IbanExternalAccountInfo.yaml | ||
| - title: Idr Account | ||
| $ref: ./IdrExternalAccountInfo.yaml | ||
| - title: Inr Account | ||
| $ref: ./InrExternalAccountInfo.yaml | ||
| - title: Mxn Account | ||
| $ref: ./MxnExternalAccountInfo.yaml | ||
| - title: Myr Account | ||
| $ref: ./MyrExternalAccountInfo.yaml | ||
| - title: Ngn Account | ||
| $ref: ./NgnExternalAccountInfo.yaml | ||
| - title: Php Account | ||
| $ref: ./PhpExternalAccountInfo.yaml | ||
| - title: Pix Account | ||
| $ref: ./PixExternalAccountInfo.yaml | ||
| - title: Sgd Account | ||
| $ref: ./SgdExternalAccountInfo.yaml | ||
| - title: Thb Account | ||
| $ref: ./ThbExternalAccountInfo.yaml | ||
| - title: Upi Account | ||
| $ref: ./UpiExternalAccountInfo.yaml | ||
| - title: Us Account | ||
| $ref: ./UsExternalAccountInfo.yaml | ||
| - title: Usd Account | ||
| $ref: ./UsdExternalAccountInfo.yaml | ||
| - title: Vnd Account |
There was a problem hiding this comment.
Duplicate entries in oneOf array for multiple currencies. The sync added new entries (e.g., "Cad Account", "Gbp Account", "Pix Account") that duplicate existing ones (e.g., "CAD Account", "GBP Account", "PIX Account") with only capitalization differences. This creates 10 duplicate account types:
- CAD Account (line 7) & Cad Account (line 19)
- CLABE Account (line 3) & Clabe Account (line 21)
- GBP Account (line 9) & Gbp Account (line 23)
- IBAN Account (line 5) & Iban Account (line 25)
- NGN Account (line 11) & Ngn Account (line 33)
- PHP Account (line 13) & Php Account (line 35)
- PIX Account (line 1) & Pix Account (line 37)
- SGD Account (line 15) & Sgd Account (line 39)
- UPI Account (line 7) & Upi Account (line 43)
- US Account (line ~) & Us Account (line 45)
The new entries reference different schema files (e.g., CadExternalAccountInfo.yaml vs CadAccountExternalAccountInfo.yaml). Both sets of files exist but have different structures - the old files use BeneficiaryOneOf.yaml while new files use currency-specific beneficiary schemas with inline discriminators.
Remove either the old entries (lines 1-16) or the new entries (lines 18-48) to eliminate duplicates.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 1:72
Comment:
Duplicate entries in `oneOf` array for multiple currencies. The sync added new entries (e.g., "Cad Account", "Gbp Account", "Pix Account") that duplicate existing ones (e.g., "CAD Account", "GBP Account", "PIX Account") with only capitalization differences. This creates 10 duplicate account types:
- CAD Account (line 7) & Cad Account (line 19)
- CLABE Account (line 3) & Clabe Account (line 21)
- GBP Account (line 9) & Gbp Account (line 23)
- IBAN Account (line 5) & Iban Account (line 25)
- NGN Account (line 11) & Ngn Account (line 33)
- PHP Account (line 13) & Php Account (line 35)
- PIX Account (line 1) & Pix Account (line 37)
- SGD Account (line 15) & Sgd Account (line 39)
- UPI Account (line 7) & Upi Account (line 43)
- US Account (line ~) & Us Account (line 45)
The new entries reference different schema files (e.g., `CadExternalAccountInfo.yaml` vs `CadAccountExternalAccountInfo.yaml`). Both sets of files exist but have different structures - the old files use `BeneficiaryOneOf.yaml` while new files use currency-specific beneficiary schemas with inline discriminators.
Remove either the old entries (lines 1-16) or the new entries (lines 18-48) to eliminate duplicates.
How can I resolve this? If you propose a fix, please make it concise.| type: object | ||
| required: | ||
| - sortCode | ||
| - accountNumber | ||
| - accountType | ||
| - sortCode | ||
| - accountNumber | ||
| properties: | ||
| accountType: | ||
| type: string | ||
| enum: | ||
| - GBP_ACCOUNT | ||
| sortCode: | ||
| type: string | ||
| description: UK bank sort code (6 digits, may include hyphens) | ||
| example: '20-00-00' | ||
| pattern: '^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$' | ||
| description: The sort code of the bank | ||
| accountNumber: | ||
| type: string | ||
| description: UK bank account number (8 digits) | ||
| example: '12345678' | ||
| minLength: 8 | ||
| maxLength: 8 | ||
| pattern: ^[0-9]{8}$ | ||
| description: The account number of the bank |
There was a problem hiding this comment.
Removed valuable validation and documentation. The previous version included:
- Pattern validation for sort code:
^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$ - Pattern validation for account number:
^[0-9]{8}$ - Length constraints (8 digits for account number)
- Descriptive text: "UK bank sort code (6 digits, may include hyphens)"
- Examples:
'20-00-00','12345678'
New version has only generic descriptions like "The sort code of the bank". If this is intentional for flexibility, consider documenting why validation was removed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/GbpAccountInfo.yaml
Line: 1:11
Comment:
Removed valuable validation and documentation. The previous version included:
- Pattern validation for sort code: `^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$`
- Pattern validation for account number: `^[0-9]{8}$`
- Length constraints (8 digits for account number)
- Descriptive text: "UK bank sort code (6 digits, may include hyphens)"
- Examples: `'20-00-00'`, `'12345678'`
New version has only generic descriptions like "The sort code of the bank". If this is intentional for flexibility, consider documenting why validation was removed.
How can I resolve this? If you propose a fix, please make it concise.| type: object | ||
| required: | ||
| - bankName | ||
| - swiftCode | ||
| - accountNumber | ||
| - accountType | ||
| - bankName | ||
| - accountNumber | ||
| properties: | ||
| accountType: | ||
| type: string | ||
| enum: | ||
| - SGD_ACCOUNT | ||
| bankName: | ||
| type: string | ||
| description: Name of the beneficiary's bank | ||
| example: DBS Bank Ltd | ||
| swiftCode: | ||
| type: string | ||
| description: SWIFT/BIC code (8 or 11 characters) | ||
| example: DBSSSGSG | ||
| minLength: 8 | ||
| maxLength: 11 | ||
| pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$ | ||
| description: The bank name of the bank | ||
| accountNumber: | ||
| type: string | ||
| description: Bank account number | ||
| example: '0123456789' | ||
| description: The account number of the bank |
There was a problem hiding this comment.
Removed swiftCode field entirely, along with all validation patterns and examples. Previous version had SWIFT code validation (^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$) and was a required field. Verify this field removal is intentional for SGD accounts.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/SgdAccountInfo.yaml
Line: 1:11
Comment:
Removed `swiftCode` field entirely, along with all validation patterns and examples. Previous version had SWIFT code validation (`^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$`) and was a required field. Verify this field removal is intentional for SGD accounts.
How can I resolve this? If you propose a fix, please make it concise.| @@ -16,5 +9,15 @@ enum: | |||
| - TRON_WALLET | |||
| - POLYGON_WALLET | |||
| - BASE_WALLET | |||
| - BRL_ACCOUNT | |||
| - DKK_ACCOUNT | |||
There was a problem hiding this comment.
Removed support for several account types without replacements: US_ACCOUNT (replaced by USD_ACCOUNT), CAD_ACCOUNT, CLABE, PIX, IBAN, UPI, and NGN_ACCOUNT. This is a breaking API change. The corresponding common schemas (CadAccountInfo.yaml, ClabeAccountInfo.yaml, etc.) still exist but are no longer referenced by external account schemas. Verify this removal is intentional for the schema sync.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountType.yaml
Line: 1:13
Comment:
Removed support for several account types without replacements: `US_ACCOUNT` (replaced by `USD_ACCOUNT`), `CAD_ACCOUNT`, `CLABE`, `PIX`, `IBAN`, `UPI`, and `NGN_ACCOUNT`. This is a breaking API change. The corresponding common schemas (`CadAccountInfo.yaml`, `ClabeAccountInfo.yaml`, etc.) still exist but are no longer referenced by external account schemas. Verify this removal is intentional for the schema sync.
How can I resolve this? If you propose a fix, please make it concise.| external_account_create: '#/components/schemas/ExternalAccountCreateRequest' | ||
| lightning_external_account_info: "#/components/schemas/LightningExternalAccountInfo" | ||
| ngn_account_external_account_info: "#/components/schemas/NgnAccountExternalAccountInfo" | ||
| ngn_external_account_info: "#/components/schemas/NgnExternalAccountInfo" |
There was a problem hiding this comment.
Reference to NgnExternalAccountInfo schema doesn't exist. NGN_ACCOUNT was removed from ExternalAccountType enum and NgnAccountExternalAccountInfo.yaml was deleted. This reference needs to be removed or the schema needs to be added back.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 112:112
Comment:
Reference to `NgnExternalAccountInfo` schema doesn't exist. `NGN_ACCOUNT` was removed from `ExternalAccountType` enum and `NgnAccountExternalAccountInfo.yaml` was deleted. This reference needs to be removed or the schema needs to be added back.
How can I resolve this? If you propose a fix, please make it concise.
Auto-synced account schemas.
These schemas are generated from VASP adapter field definitions in sparkcore.
Synced directories:
common/— per-currency account info and beneficiary schemasexternal_accounts/— per-currency external account schemas (reference common/)Please review the changes before merging.