feat: adding country code to external account response#262
feat: adding country code to external account response#262
Conversation
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
⏳ grid-kotlin studio⏳ These are partial results; builds are still running. This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryThis PR adds an optional
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/external_accounts/ExternalAccount.yaml | Adds optional countryCode field with correct type, description, length constraints, and pattern: '^[A-Z]{2}$' for ISO 3166-1 alpha-2 enforcement. |
| openapi.yaml | Adds countryCode field but is missing the pattern: '^[A-Z]{2}$' constraint present in the source component schema, making validation weaker than intended. |
| mintlify/openapi.yaml | Same as openapi.yaml — adds countryCode but is missing the pattern constraint from the source component schema. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ExternalAccount.yaml\nsource schema] -->|bundled into| B[openapi.yaml]
A -->|bundled into| C[mintlify/openapi.yaml]
A -- "countryCode\nminLength: 2\nmaxLength: 2\npattern: '^[A-Z]{2}$'" --> D{Validation}
B -- "countryCode\nminLength: 2\nmaxLength: 2\n❌ missing pattern" --> E{Weaker Validation}
C -- "countryCode\nminLength: 2\nmaxLength: 2\n❌ missing pattern" --> E
D -->|accepts only| F["'IN', 'US', 'GB'"]
E -->|also accepts| G["'1A', 'ab', '12'"]
Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi.yaml
Line: 7417-7422
Comment:
**Missing `pattern` constraint in bundled file**
The source schema (`openapi/components/schemas/external_accounts/ExternalAccount.yaml`) includes `pattern: '^[A-Z]{2}$'` to enforce that the country code contains exactly two uppercase alphabetical characters. However, this `openapi.yaml` (and `mintlify/openapi.yaml`) is missing that constraint — only `minLength`/`maxLength` are present here.
This means validators consuming `openapi.yaml` directly would accept values like `"12"` or `"ab"` as valid country codes, while validators using the component schema would reject them.
```suggestion
countryCode:
type: string
description: ISO 3166-1 alpha-2 country code for the receiving external account, derived from the provided rail and account information.
minLength: 2
maxLength: 2
pattern: '^[A-Z]{2}$'
example: IN
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: mintlify/openapi.yaml
Line: 7417-7422
Comment:
**Missing `pattern` constraint in bundled file**
Same issue as `openapi.yaml` — the source schema (`ExternalAccount.yaml`) includes `pattern: '^[A-Z]{2}$'`, but this bundled file is missing it. Any consumer validating against `mintlify/openapi.yaml` directly would accept invalid two-character strings like `"1A"` or `"ab"`.
```suggestion
countryCode:
type: string
description: ISO 3166-1 alpha-2 country code for the receiving external account, derived from the provided rail and account information.
minLength: 2
maxLength: 2
pattern: '^[A-Z]{2}$'
example: IN
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: a758bcb
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

TL;DR
Added
countryCodefield to the ExternalAccount schema to capture the ISO 3166-1 alpha-2 country code for receiving external accounts.What changed?
Added a new
countryCodeproperty to the ExternalAccount schema with the following specifications:How to test?
countryCodefield is present in the responseWhy make this change?
This enhancement provides better geographical context for external accounts, enabling improved compliance, routing decisions, and user experience by clearly identifying the country associated with each receiving account.