-
Notifications
You must be signed in to change notification settings - Fork 4
chore: Sync account schemas #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,10 @@ type: object | |
| required: | ||
| - accountType | ||
| - paymentRails | ||
| - bankCode | ||
| - bankName | ||
| - accountNumber | ||
| - swiftCode | ||
| - swiftBic | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking field rename: The required field
Per backwards-compatibility practices, the safe migration path would be to:
If this schema is synced from sparkcore and the implementation already accepts both field names, ensure that is reflected here as well. Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/components/schemas/common/HkdAccountInfo.yaml
Line: 8
Comment:
**Breaking field rename: `swiftCode` → `swiftBic`**
The required field `swiftCode` has been renamed to `swiftBic` without a deprecation period. Any existing API consumers that submit or receive `swiftCode` in their requests/responses will now fail schema validation. This is a backwards-incompatible change across six schemas:
- `HkdAccountInfo.yaml` (line 8)
- `IdrAccountInfo.yaml`
- `MyrAccountInfo.yaml`
- `SgdAccountInfo.yaml`
- `ThbAccountInfo.yaml`
- `VndAccountInfo.yaml`
Per backwards-compatibility practices, the safe migration path would be to:
1. Add `swiftBic` as a new (initially optional) field while keeping `swiftCode`
2. Deprecate `swiftCode`
3. After a suitable notice period, make `swiftBic` required and remove `swiftCode`
If this schema is synced from sparkcore and the implementation already accepts both field names, ensure that is reflected here as well.
How can I resolve this? If you propose a fix, please make it concise. |
||
| properties: | ||
| accountType: | ||
| type: string | ||
|
|
@@ -16,18 +17,26 @@ properties: | |
| type: string | ||
| enum: | ||
| - BANK_TRANSFER | ||
| bankCode: | ||
| type: string | ||
| description: The bank code | ||
| minLength: 3 | ||
| maxLength: 3 | ||
| pattern: ^[0-9]{3}$ | ||
| bankName: | ||
| type: string | ||
| description: Name of the bank | ||
| example: HSBC Hong Kong | ||
| description: The name of the bank | ||
| minLength: 1 | ||
| maxLength: 255 | ||
| accountNumber: | ||
| type: string | ||
| description: Hong Kong bank account number | ||
| example: '123456789012' | ||
| swiftCode: | ||
| description: The account number of the bank | ||
| minLength: 1 | ||
| maxLength: 34 | ||
| swiftBic: | ||
| type: string | ||
| description: SWIFT/BIC code (8 or 11 characters) | ||
| example: HSBCHKHHHKH | ||
| description: The SWIFT/BIC code of the bank | ||
| example: DEUTDEFF | ||
| minLength: 8 | ||
| maxLength: 11 | ||
| pattern: ^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,11 @@ properties: | |
| type: string | ||
| enum: | ||
| - UPI | ||
| - IMPS | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMPS rail added without required supporting fields
Either:
Prompt To Fix With AIThis is a comment left during a code review.
Path: openapi/components/schemas/common/InrAccountInfo.yaml
Line: 17
Comment:
**IMPS rail added without required supporting fields**
`IMPS` has been added as a valid `paymentRails` value, but the schema only defines `vpa` (Virtual Payment Address) as an account identifier — which is UPI-specific. IMPS payments require different identifiers: an account number and an IFSC code. Without those fields in the schema, there is no valid way for an API consumer to provide the necessary data when using the `IMPS` rail.
Either:
1. Add the required `accountNumber` and `ifscCode` fields (conditionally required when `paymentRails` includes `IMPS`), or
2. Consider a separate `InrImpsAccountInfo` schema if the field set is substantially different from the UPI flow.
How can I resolve this? If you propose a fix, please make it concise. |
||
| vpa: | ||
| type: string | ||
| description: The VPA of the bank | ||
| description: The UPI Virtual Payment Address | ||
| example: user@upi | ||
| minLength: 3 | ||
| maxLength: 255 | ||
| pattern: ^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9]+$ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change to sort code pattern and loosened account number validation
Two changes here deserve attention:
Sort code pattern changed from
'^[0-9]{2}-?[0-9]{2}-?[0-9]{2}$'(allowingXX-XX-XXhyphenated format) to^[0-9]{6}$(digits only). The old spec explicitly documented "may include hyphens" and the example was'20-00-00'. Any existing client sending sort codes in the common hyphenated format will now fail validation. This is a breaking change for clients relying on the documented format.Account number validation removed: UK account numbers are always exactly 8 digits. The previous schema correctly enforced
pattern: ^[0-9]{8}$withminLength: 8, maxLength: 8. The new schema accepts 1–34 characters with no pattern, which would silently accept invalid account numbers.Prompt To Fix With AI