chore: Sync account schemas#551
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
|
Greptile SummaryThis PR auto-syncs CNY (Chinese Yuan) account schemas from sparkcore VASP adapter definitions, adding all the required components for CNY external accounts and payment instructions.
Confidence Score: 4/5Safe to merge; all new CNY schemas are structurally correct and consistent with existing currency patterns. The new schemas are well-formed and mirror the established AED/KES/GHS patterns accurately. The only issues are ordering inconsistencies in ExternalAccountType and ExternalAccountInfoOneOf — CNY_ACCOUNT is appended after wallet entries rather than placed alphabetically with the other fiat currencies. openapi/components/schemas/external_accounts/ExternalAccountType.yaml and ExternalAccountInfoOneOf.yaml have ordering inconsistencies worth cleaning up before merge.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/CnyAccountInfoBase.yaml | New base schema for CNY accounts; defines accountType, phoneNumber (with correct pattern/length constraints), and bankName as required fields. |
| openapi/components/schemas/common/CnyAccountInfo.yaml | Extends CnyAccountInfoBase with a required paymentRails array (MOBILE_MONEY only); consistent with single-rail currencies like KES. |
| openapi/components/schemas/common/CnyBeneficiary.yaml | Defines Individual beneficiary for CNY; address is optional (unlike AedBeneficiary where it is required), which appears intentional for this currency. |
| openapi/components/schemas/common/PaymentCnyAccountInfo.yaml | Payment variant of CNY account; follows the same BasePaymentAccountInfo + CnyAccountInfo + reference field pattern used by all other fiat payment account schemas. |
| openapi/components/schemas/common/PaymentInstructions.yaml | Adds PaymentCnyAccountInfo to the oneOf list (before wallet entries) and CNY_ACCOUNT to the discriminator mapping; correctly wired. |
| openapi/components/schemas/external_accounts/CnyExternalAccountInfo.yaml | New external account schema for CNY; mirrors the AED pattern (BaseExternalAccountInfo + CnyAccountInfo + Individual/Business beneficiary discriminator). |
| openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml | Adds CnyExternalAccountInfo to the oneOf and discriminator mapping, but places it after TronWallet instead of in alphabetical order with other fiat currencies. |
| openapi/components/schemas/external_accounts/ExternalAccountType.yaml | Appends CNY_ACCOUNT at the end of the enum, breaking the alphabetical ordering convention maintained for all fiat currencies. |
| openapi.yaml | Generated bundle — reflects all new CNY schemas correctly; not edited directly per repo convention. |
| mintlify/openapi.yaml | Mintlify copy of the generated bundle — identical CNY additions, correctly regenerated. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class CnyAccountInfoBase {
+string accountType (CNY_ACCOUNT)
+string phoneNumber
+string bankName
}
class CnyAccountInfo {
+string[] paymentRails (MOBILE_MONEY)
}
class PaymentCnyAccountInfo {
+string reference
}
class CnyExternalAccountInfo {
+beneficiary oneOf
}
class CnyBeneficiary {
+string beneficiaryType (INDIVIDUAL)
+string fullName
+string? birthDate
+string? nationality
+string? email
+string? phoneNumber
+string? countryOfResidence
+Address? address
}
class BasePaymentAccountInfo
class BaseExternalAccountInfo
class BusinessBeneficiary
CnyAccountInfo --|> CnyAccountInfoBase : allOf
PaymentCnyAccountInfo --|> BasePaymentAccountInfo : allOf
PaymentCnyAccountInfo --|> CnyAccountInfo : allOf
CnyExternalAccountInfo --|> BaseExternalAccountInfo : allOf
CnyExternalAccountInfo --|> CnyAccountInfo : allOf
CnyExternalAccountInfo --> CnyBeneficiary : beneficiary (oneOf)
CnyExternalAccountInfo --> BusinessBeneficiary : beneficiary (oneOf)
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
openapi/components/schemas/external_accounts/ExternalAccountType.yaml:47
**CNY_ACCOUNT ordering breaks alphabetical convention**
All fiat currency entries in this enum (AED through ZMW) are alphabetically ordered. `CNY_ACCOUNT` is appended after `TRON_WALLET` instead of between `BWP_ACCOUNT` and `CAD_ACCOUNT`. While OpenAPI doesn't enforce enum ordering, it breaks the established pattern maintained across every other fiat currency entry.
### Issue 2 of 2
openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml:46
**CnyExternalAccountInfo oneOf entry out of alphabetical order**
The existing `oneOf` list follows alphabetical order for fiat currency entries (Aed → Zmw) before the wallet types. `CnyExternalAccountInfo` is appended at the very end (after `TronWalletExternalAccountInfo`) instead of between `BwpExternalAccountInfo` and `CadExternalAccountInfo`. The same inconsistency appears in the `discriminator.mapping` block. For consistency with the rest of this file, both should be positioned alphabetically with the other fiat accounts.
Reviews (1): Last reviewed commit: "chore: Sync account schemas" | Re-trigger Greptile
| - SOLANA_WALLET | ||
| - SPARK_WALLET | ||
| - TRON_WALLET | ||
| - CNY_ACCOUNT |
There was a problem hiding this comment.
CNY_ACCOUNT ordering breaks alphabetical convention
All fiat currency entries in this enum (AED through ZMW) are alphabetically ordered. CNY_ACCOUNT is appended after TRON_WALLET instead of between BWP_ACCOUNT and CAD_ACCOUNT. While OpenAPI doesn't enforce enum ordering, it breaks the established pattern maintained across every other fiat currency entry.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountType.yaml
Line: 47
Comment:
**CNY_ACCOUNT ordering breaks alphabetical convention**
All fiat currency entries in this enum (AED through ZMW) are alphabetically ordered. `CNY_ACCOUNT` is appended after `TRON_WALLET` instead of between `BWP_ACCOUNT` and `CAD_ACCOUNT`. While OpenAPI doesn't enforce enum ordering, it breaks the established pattern maintained across every other fiat currency entry.
How can I resolve this? If you propose a fix, please make it concise.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!
| - $ref: ./SolanaWalletExternalAccountInfo.yaml | ||
| - $ref: ./SparkWalletExternalAccountInfo.yaml | ||
| - $ref: ./TronWalletExternalAccountInfo.yaml | ||
| - $ref: ./CnyExternalAccountInfo.yaml |
There was a problem hiding this comment.
CnyExternalAccountInfo oneOf entry out of alphabetical order
The existing oneOf list follows alphabetical order for fiat currency entries (Aed → Zmw) before the wallet types. CnyExternalAccountInfo is appended at the very end (after TronWalletExternalAccountInfo) instead of between BwpExternalAccountInfo and CadExternalAccountInfo. The same inconsistency appears in the discriminator.mapping block. For consistency with the rest of this file, both should be positioned alphabetically with the other fiat accounts.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 46
Comment:
**CnyExternalAccountInfo oneOf entry out of alphabetical order**
The existing `oneOf` list follows alphabetical order for fiat currency entries (Aed → Zmw) before the wallet types. `CnyExternalAccountInfo` is appended at the very end (after `TronWalletExternalAccountInfo`) instead of between `BwpExternalAccountInfo` and `CadExternalAccountInfo`. The same inconsistency appears in the `discriminator.mapping` block. For consistency with the rest of this file, both should be positioned alphabetically with the other fiat accounts.
How can I resolve this? If you propose a fix, please make it concise.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!
The auto-sync workflow's create_external_accounts.py only generates
the read-side `{Currency}ExternalAccountInfo.yaml`; the create-side
`{Currency}ExternalAccountCreateInfo.yaml` is hand-authored per
corridor and was missed when CNY landed via #551. Without the Create
variant in `ExternalAccountCreateInfoOneOf`, the discriminator can't
dispatch `accountType: CNY_ACCOUNT` on POST /customers/external-
accounts and the request fails with "did not match any expected shape".
This adds the missing schema (mirroring the existing
BdtExternalAccountCreateInfo template) and inserts the $ref in the
CreateInfoOneOf alphabetically between Cad and Cop.
Auto-synced account schemas.
These schemas are generated from VASP adapter field definitions in sparkcore.
Synced schemas:
common/— per-currency account info, beneficiary, and payment account schemascommon/PaymentInstructions.yaml— payment instructions oneOf (new currencies added)external_accounts/— per-currency external account schemas (reference common/)Please review the changes before merging.