Revert "chore: Sync account schemas" - #395
Conversation
This reverts commit a230551.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript
|
Greptile SummaryThis PR reverts #388 ("chore: Sync account schemas"), restoring previous account info schemas across 42 files. The bulk of changes are removing
Confidence Score: 4/5Safe to merge with a minor fix: bankName in CopAccountInfoBase should have minLength: 1 to prevent empty-string submissions on a required field. One P1 finding: the required bankName field in CopAccountInfoBase has no minLength constraint, allowing empty strings past schema validation. The rest of the changes (example block removals, beneficiary required-field relaxations, new MOBILE_MONEY/BANK_TRANSFER enum values) are clean. The bankAccountType documentation note in UsdAccountInfoBase is a P2 concern only. openapi/components/schemas/common/CopAccountInfoBase.yaml — required bankName field missing minLength constraint.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/CopAccountInfoBase.yaml | Reverts bankName to required-but-unconstrained (no minLength/maxLength), adds required phoneNumber, adds MOBILE_MONEY payment method — bankName allows empty strings. |
| openapi/components/schemas/common/UsdAccountInfoBase.yaml | Adds optional bankAccountType (described as corridor-conditionally required) and removes the example block; conditional requirement not enforced by schema. |
| openapi/components/schemas/common/GtqAccountInfoBase.yaml | Reverts to phoneNumber-only account schema, removing bankName and bankAccountType entirely from properties and required list. |
| openapi/components/schemas/common/UsdBeneficiary.yaml | Removes address, birthDate, and nationality from required fields — backward compatible relaxation. |
| openapi/components/schemas/common/CopBeneficiary.yaml | Swaps required fields: documentNumber and documentType removed; countryOfResidence becomes required. |
| openapi/components/schemas/common/GtqBeneficiary.yaml | phoneNumber removed from required fields — backward compatible relaxation. |
| openapi/components/schemas/common/CopAccountInfo.yaml | Adds MOBILE_MONEY as a valid payment method enum value alongside BANK_TRANSFER. |
| openapi/components/schemas/common/GtqAccountInfo.yaml | Adds MOBILE_MONEY as a valid payment method enum value alongside BANK_TRANSFER. |
| openapi/components/schemas/common/UsdAccountInfo.yaml | Adds BANK_TRANSFER as a valid payment method enum value alongside ACH, WIRE, RTP, FEDNOW. |
| openapi/components/schemas/common/AedAccountInfoBase.yaml | Example block removed; no structural changes. |
| openapi/components/schemas/common/BdtAccountInfoBase.yaml | bankName removed from required list and properties, example block removed. |
| openapi/components/schemas/common/EgpAccountInfoBase.yaml | bankName removed from required list and properties, example block removed. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Account Info Request] --> B{Currency / Corridor}
B -->|COP| C[CopAccountInfoBase\nrequired: accountType, accountNumber,\nbankAccountType, bankName, phoneNumber]
B -->|GTQ| D[GtqAccountInfoBase\nrequired: accountType, accountNumber, phoneNumber]
B -->|USD| E[UsdAccountInfoBase\nrequired: accountType, accountNumber, routingNumber\noptional: bankAccountType ⚠️ required for El Salvador]
B -->|Other| F[Currency-specific schema\nexamples removed]
C --> G{Payment type}
D --> G
G -->|BANK_TRANSFER| H[Bank Transfer flow]
G -->|MOBILE_MONEY| I[Mobile Money flow ✨ new enum]
E --> J{Payment type}
J -->|ACH / WIRE / RTP / FEDNOW| K[Existing US rails]
J -->|BANK_TRANSFER| L[Bank Transfer ✨ new enum]
Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/CopAccountInfoBase.yaml
Line: 24-26
Comment:
**`bankName` required but lacks length constraints**
`bankName` is listed as required but has no `minLength` or `maxLength` constraints, meaning an empty string `""` would pass schema validation. The schema removed from PR #388 had `minLength: 1, maxLength: 255` on this field. Without `minLength: 1`, a caller can submit an empty bank name and the spec won't reject it.
```suggestion
bankName:
type: string
description: The name of the bank
minLength: 1
maxLength: 255
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: openapi/components/schemas/common/UsdAccountInfoBase.yaml
Line: 23-28
Comment:
**`bankAccountType` described as conditionally required but not enforced by schema**
The description says "Required for certain corridors (e.g., El Salvador)" yet the field is absent from the `required` array, so the schema won't reject requests that omit it for those corridors. This is a documentation/validation mismatch that could cause silent failures server-side for El Salvador payments. Consider either adding conditional validation (`if`/`then`) or at minimum documenting server-side enforcement so consumers don't rely on the spec for correctness.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Revert "chore: Sync account schemas (#38..." | Re-trigger Greptile
| bankName: | ||
| type: string | ||
| description: The name of the bank |
There was a problem hiding this comment.
bankName required but lacks length constraints
bankName is listed as required but has no minLength or maxLength constraints, meaning an empty string "" would pass schema validation. The schema removed from PR #388 had minLength: 1, maxLength: 255 on this field. Without minLength: 1, a caller can submit an empty bank name and the spec won't reject it.
| bankName: | |
| type: string | |
| description: The name of the bank | |
| bankName: | |
| type: string | |
| description: The name of the bank | |
| minLength: 1 | |
| maxLength: 255 |
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/CopAccountInfoBase.yaml
Line: 24-26
Comment:
**`bankName` required but lacks length constraints**
`bankName` is listed as required but has no `minLength` or `maxLength` constraints, meaning an empty string `""` would pass schema validation. The schema removed from PR #388 had `minLength: 1, maxLength: 255` on this field. Without `minLength: 1`, a caller can submit an empty bank name and the spec won't reject it.
```suggestion
bankName:
type: string
description: The name of the bank
minLength: 1
maxLength: 255
```
How can I resolve this? If you propose a fix, please make it concise.| bankAccountType: | ||
| type: string | ||
| description: The bank account type. Required for certain corridors (e.g., El Salvador). | ||
| enum: | ||
| - CHECKING | ||
| - SAVINGS |
There was a problem hiding this comment.
bankAccountType described as conditionally required but not enforced by schema
The description says "Required for certain corridors (e.g., El Salvador)" yet the field is absent from the required array, so the schema won't reject requests that omit it for those corridors. This is a documentation/validation mismatch that could cause silent failures server-side for El Salvador payments. Consider either adding conditional validation (if/then) or at minimum documenting server-side enforcement so consumers don't rely on the spec for correctness.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/UsdAccountInfoBase.yaml
Line: 23-28
Comment:
**`bankAccountType` described as conditionally required but not enforced by schema**
The description says "Required for certain corridors (e.g., El Salvador)" yet the field is absent from the `required` array, so the schema won't reject requests that omit it for those corridors. This is a documentation/validation mismatch that could cause silent failures server-side for El Salvador payments. Consider either adding conditional validation (`if`/`then`) or at minimum documenting server-side enforcement so consumers don't rely on the spec for correctness.
How can I resolve this? If you propose a fix, please make it concise.
Reverts #388