chore: Sync account schemas#529
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
|
Greptile SummaryThis auto-synced PR updates EGP and COP account schemas to reflect changes in VASP adapter field definitions, and introduces
Confidence Score: 4/5Safe to merge; changes are generated from backend definitions and the bundles are correctly regenerated. The core schema additions (PaymentSwiftAccountInfo, MOBILE_MONEY rail for EGP) look correct and consistent with the established pattern used for COP. The two points needing a second look are: (1) EgpBeneficiary now treats address, countryOfResidence, and phoneNumber as optional — confirming the upstream VASP adapter genuinely relaxed these would add confidence; (2) the CopBeneficiary documentType description lost the per-code labels that help integrators understand what CC, CE, TI, NIT, and PP stand for. openapi/components/schemas/common/EgpBeneficiary.yaml — verify the required-field relaxation matches backend behaviour; openapi/components/schemas/common/CopBeneficiary.yaml — consider restoring enum-value labels to documentType description.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/EgpAccountInfoBase.yaml | Removed bankName, accountNumber, swiftCode fields; replaced with phoneNumber. Added MOBILE_MONEY rail support and conditional-required documentation via description. Only accountType remains in the required array. |
| openapi/components/schemas/common/EgpAccountInfo.yaml | Added MOBILE_MONEY to the paymentRails enum to match the new EgpAccountInfoBase phoneNumber field. |
| openapi/components/schemas/common/EgpBeneficiary.yaml | Removed address, countryOfResidence, and phoneNumber from required; these fields remain in properties as optional. Needs confirmation that the VASP adapter treats them as truly optional. |
| openapi/components/schemas/common/CopAccountInfoBase.yaml | Removed bankName field entirely; simplified field descriptions; updated example to include phoneNumber instead of bankName. |
| openapi/components/schemas/common/CopBeneficiary.yaml | Shortened documentType and documentNumber descriptions, removing the per-enum-value labels that help consumers understand what CC, CE, TI, NIT, PP mean. |
| openapi/components/schemas/common/PaymentSwiftAccountInfo.yaml | New file composing BasePaymentAccountInfo + SwiftAccountInfo and adding a required reference field for payment crediting. |
| openapi/components/schemas/common/PaymentInstructions.yaml | Added PaymentSwiftAccountInfo to the oneOf list and SWIFT_ACCOUNT to the discriminator mapping; straightforward extension. |
| openapi.yaml | Bundled output regenerated from source files; SwiftAccountInfoBase/SwiftAccountInfo relocated earlier in the file, PaymentSwiftAccountInfo added inline, EGP/COP schema changes applied. |
| mintlify/openapi.yaml | Mintlify-bundled copy of openapi.yaml, identical changes to the root bundle; changes look correctly mirrored. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
PI[PaymentInstructions oneOf] --> EGP[PaymentEgpAccountInfo]
PI --> COP[PaymentCopAccountInfo]
PI --> SWIFT[PaymentSwiftAccountInfo NEW]
PI --> OTHER[...other currencies...]
EGP --> EGPB[EgpAccountInfoBase]
EGPB -->|BANK_TRANSFER rail| IBAN[iban field EG IBAN pattern]
EGPB -->|MOBILE_MONEY rail NEW| PHONE[phoneNumber field]
SWIFT --> BASE[BasePaymentAccountInfo]
SWIFT --> SWB[SwiftAccountInfoBase accountType swiftCode bankName country]
SWIFT --> REF[reference field required NEW]
COP[CopAccountInfoBase] -->|BANK_TRANSFER| ACCT[accountNumber bankAccountType]
COP -->|MOBILE_MONEY| CPHONE[phoneNumber]
COP -.->|removed| BNAME[bankName]
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/common/CopBeneficiary.yaml:33
The `documentType` description was reduced to "Identity document type (Colombia)", dropping the enumeration of what each code means. Without those labels (e.g. CC = Cédula de Ciudadanía, NIT = Número de Identificación Tributaria), API consumers filling in this field must guess or consult external sources — especially important for non-Colombian integrators.
```suggestion
description: 'Identity document type (Colombia). CC: Cédula de Ciudadanía, CE: Cédula de Extranjería, TI: Tarjeta de Identidad, NIT: Número de Identificación Tributaria, PP: Passport'
```
### Issue 2 of 2
openapi/components/schemas/common/EgpBeneficiary.yaml:3-5
`address`, `countryOfResidence`, and `phoneNumber` were previously required on `EgpBeneficiary`. Removing them from `required` means schema-level validation will no longer enforce these fields. If Egyptian payment rails still mandate them at runtime, callers who omit them will receive opaque backend errors rather than a clear 400 at the schema validation layer. Worth confirming the VASP adapter truly treats all three as optional before merging.
Reviews (1): Last reviewed commit: "chore: Sync account schemas" | Re-trigger Greptile
| description: 'Identity document type — required by most Colombian banks. | ||
| CC: Cédula de Ciudadanía, CE: Cédula de Extranjería, TI: Tarjeta de | ||
| Identidad, NIT: Número de Identificación Tributaria, PP: Passport' | ||
| description: Identity document type (Colombia) |
There was a problem hiding this comment.
The
documentType description was reduced to "Identity document type (Colombia)", dropping the enumeration of what each code means. Without those labels (e.g. CC = Cédula de Ciudadanía, NIT = Número de Identificación Tributaria), API consumers filling in this field must guess or consult external sources — especially important for non-Colombian integrators.
| description: Identity document type (Colombia) | |
| description: 'Identity document type (Colombia). CC: Cédula de Ciudadanía, CE: Cédula de Extranjería, TI: Tarjeta de Identidad, NIT: Número de Identificación Tributaria, PP: Passport' |
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/CopBeneficiary.yaml
Line: 33
Comment:
The `documentType` description was reduced to "Identity document type (Colombia)", dropping the enumeration of what each code means. Without those labels (e.g. CC = Cédula de Ciudadanía, NIT = Número de Identificación Tributaria), API consumers filling in this field must guess or consult external sources — especially important for non-Colombian integrators.
```suggestion
description: 'Identity document type (Colombia). CC: Cédula de Ciudadanía, CE: Cédula de Extranjería, TI: Tarjeta de Identidad, NIT: Número de Identificación Tributaria, PP: Passport'
```
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!
| required: | ||
| - beneficiaryType | ||
| - address | ||
| - countryOfResidence | ||
| - fullName |
There was a problem hiding this comment.
address, countryOfResidence, and phoneNumber were previously required on EgpBeneficiary. Removing them from required means schema-level validation will no longer enforce these fields. If Egyptian payment rails still mandate them at runtime, callers who omit them will receive opaque backend errors rather than a clear 400 at the schema validation layer. Worth confirming the VASP adapter truly treats all three as optional before merging.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/EgpBeneficiary.yaml
Line: 3-5
Comment:
`address`, `countryOfResidence`, and `phoneNumber` were previously required on `EgpBeneficiary`. Removing them from `required` means schema-level validation will no longer enforce these fields. If Egyptian payment rails still mandate them at runtime, callers who omit them will receive opaque backend errors rather than a clear 400 at the schema validation layer. Worth confirming the VASP adapter truly treats all three as optional before merging.
How can I resolve this? If you propose a fix, please make it concise.| bankName: | ||
| type: string | ||
| description: The name of the bank | ||
| minLength: 1 | ||
| maxLength: 255 | ||
| accountNumber: | ||
| type: string | ||
| description: The account number of the bank | ||
| minLength: 1 | ||
| maxLength: 34 |
There was a problem hiding this comment.
@mohamedwane @AaryamanBhute were these actually meant to be removed in the auto-generation of this account type? I seems like actually maybe they just should have been made optional, but I'm not sure why the generator removed them. This is causing some ty issues downstream in sparkcore.
There was a problem hiding this comment.
Looks like this was dropped by this commit - @JasonCWang was this intentional?
There was a problem hiding this comment.
I made the generator drop bank fields if they're not being used at all, it'll be required if its used amongst all regions/rails with that currency, and optional if it's used by at least 1
There was a problem hiding this comment.
Yeah that was intentional. I used the thunes prod discovery endpoint to refactor all the required fields.
I think this PR may have not used the openapi schema generator and updated the grid-api models which is causing issues.
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.