Skip to content

feat: add NGN and CAD external account and beneficiary schemas#226

Merged
AaryamanBhute merged 3 commits intomainfrom
add-ngn-and-cad
Feb 25, 2026
Merged

feat: add NGN and CAD external account and beneficiary schemas#226
AaryamanBhute merged 3 commits intomainfrom
add-ngn-and-cad

Conversation

@AaryamanBhute
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

✱ Stainless preview builds

This PR will update the grid SDKs with the following commit messages.

kotlin

feat(api): add CAD/NGN account types to external accounts

openapi

feat(api): add CAD and NGN account types to external accounts

python

feat(api): add CAD and NGN account types to external account info

typescript

feat(api): add CAD and NGN account types to external accounts
grid-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

grid-python studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

pip install https://pkg.stainless.com/s/grid-python/eb5a3e0d4735d2b3869e683b52f5fcbc8b1fe2dc/grid-0.0.1-py3-none-any.whl
grid-kotlin studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

grid-typescript studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/ec58891a5b1855b44fcabbddc027c2f8dcef7abb/dist.tar.gz

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-02-25 04:39:14 UTC

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

This PR adds NGN (Nigerian Naira) and CAD (Canadian Dollar) support to the external accounts system by introducing new beneficiary schemas, external account info schemas, and wiring them into the ExternalAccountType enum, ExternalAccountInfoOneOf discriminated union, and Stainless SDK config.

Confidence Score: 3/5

  • Functionally correct but has inconsistencies with recently established patterns that may cause Mintlify rendering issues for the new currency beneficiaries.
  • The core schema additions are correct — CAD and NGN are properly wired into the enum, discriminator, and Stainless config. However, the new beneficiary schemas are missing the title: Individual Beneficiary field that PR fix: remove duplicate discriminators and move titles to fix Mintlify rendering #221 specifically added to all other beneficiary schemas to fix Mintlify rendering, and the ExternalAccountInfo files use the old $ref-sibling title pattern that PR fix: remove duplicate discriminators and move titles to fix Mintlify rendering #221 removed. This risks the same Mintlify rendering issue the prior PR fixed.
  • openapi/components/schemas/common/CadBeneficiary.yaml and openapi/components/schemas/common/NgnBeneficiary.yaml need title: Individual Beneficiary added. CadExternalAccountInfo.yaml and NgnExternalAccountInfo.yaml should have $ref-sibling titles removed to match the established pattern.

Important Files Changed

Filename Overview
openapi/components/schemas/common/CadBeneficiary.yaml New CAD beneficiary schema — missing title: Individual Beneficiary that all other beneficiary schemas have (added in PR #221 for Mintlify rendering).
openapi/components/schemas/common/NgnBeneficiary.yaml New NGN beneficiary schema — missing title: Individual Beneficiary that all other beneficiary schemas have (added in PR #221 for Mintlify rendering).
openapi/components/schemas/external_accounts/CadExternalAccountInfo.yaml New CAD external account info — uses title as $ref siblings in beneficiary oneOf, which is the pattern PR #221 explicitly removed from other schemas because titles were lost during Mintlify rendering.
openapi/components/schemas/external_accounts/NgnExternalAccountInfo.yaml New NGN external account info — same pattern inconsistency as CAD with title as $ref siblings in beneficiary oneOf instead of in the schema files.
openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml Adds CAD and NGN to the oneOf/discriminator. Also re-adds title as $ref siblings for all entries — redundant with schema-level titles but not harmful here since the top-level schema titles are authoritative.
openapi/components/schemas/external_accounts/ExternalAccountType.yaml Correctly adds CAD_ACCOUNT and NGN_ACCOUNT enum values in proper position.
.stainless/stainless.yml Adds cad_account_info and ngn_account_info models to the Stainless configuration. Correctly placed in alphabetical order.
openapi.yaml Generated bundle — correctly includes all new schemas and titles. Consistent with mintlify/openapi.yaml.
mintlify/openapi.yaml Generated bundle — identical to openapi.yaml, correctly includes all new schemas.

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class ExternalAccountInfoOneOf {
        <<oneOf discriminator>>
        accountType: ExternalAccountType
    }
    class CadExternalAccountInfo {
        <<allOf>>
        title: CAD Account
    }
    class NgnExternalAccountInfo {
        <<allOf>>
        title: NGN Account
    }
    class BaseExternalAccountInfo {
        accountType: ExternalAccountType
    }
    class CadAccountInfo {
        accountType: CAD_ACCOUNT
        bankCode: string
        branchCode: string
        accountNumber: string
    }
    class NgnAccountInfo {
        accountType: NGN_ACCOUNT
        accountNumber: string
        bankName: string
    }
    class CadBeneficiary {
        beneficiaryType: INDIVIDUAL
        fullName: string
        birthDate: string
        address: Address
    }
    class NgnBeneficiary {
        beneficiaryType: INDIVIDUAL
        fullName: string
        birthDate: string
        address: Address
    }
    class BusinessBeneficiary {
        beneficiaryType: BUSINESS
        legalName: string
    }

    ExternalAccountInfoOneOf --> CadExternalAccountInfo : CAD_ACCOUNT
    ExternalAccountInfoOneOf --> NgnExternalAccountInfo : NGN_ACCOUNT
    CadExternalAccountInfo --|> BaseExternalAccountInfo
    CadExternalAccountInfo --|> CadAccountInfo
    NgnExternalAccountInfo --|> BaseExternalAccountInfo
    NgnExternalAccountInfo --|> NgnAccountInfo
    CadExternalAccountInfo --> CadBeneficiary : INDIVIDUAL
    CadExternalAccountInfo --> BusinessBeneficiary : BUSINESS
    NgnExternalAccountInfo --> NgnBeneficiary : INDIVIDUAL
    NgnExternalAccountInfo --> BusinessBeneficiary : BUSINESS
Loading

Last reviewed commit: 7f1d70f

AaryamanBhute and others added 3 commits February 24, 2026 20:18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add title to NgnExternalAccountInfo and CadExternalAccountInfo
discriminated schemas. Remove redundant discriminator from
BaseExternalAccountInfo since ExternalAccountInfoOneOf already
defines it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

@@ -0,0 +1,32 @@
type: object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing title: Individual Beneficiary

Every other beneficiary schema in the repo (BRL, DKK, EUR, GBP, HKD, IDR, INR, MXN, MYR, PHP, SGD, THB, USD, VND) has title: Individual Beneficiary as the first line. This was specifically added in PR #221 to fix Mintlify rendering — titles placed as $ref siblings (like in CadExternalAccountInfo.yaml line 11) are lost during Mintlify's schema resolution, so they must live in the schema file itself.

Without this, the CAD beneficiary will render without a title in Mintlify docs.

The same issue applies to openapi/components/schemas/common/NgnBeneficiary.yaml.

Suggested change
type: object
title: Individual Beneficiary
type: object
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/CadBeneficiary.yaml
Line: 1

Comment:
**Missing `title: Individual Beneficiary`**

Every other beneficiary schema in the repo (BRL, DKK, EUR, GBP, HKD, IDR, INR, MXN, MYR, PHP, SGD, THB, USD, VND) has `title: Individual Beneficiary` as the first line. This was specifically added in PR #221 to fix Mintlify rendering — titles placed as `$ref` siblings (like in `CadExternalAccountInfo.yaml` line 11) are lost during Mintlify's schema resolution, so they must live in the schema file itself.

Without this, the CAD beneficiary will render without a title in Mintlify docs.

The same issue applies to `openapi/components/schemas/common/NgnBeneficiary.yaml`.

```suggestion
title: Individual Beneficiary
type: object
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +10 to +14
oneOf:
- title: Individual Beneficiary
$ref: ../common/CadBeneficiary.yaml
- title: Business Beneficiary
$ref: ../common/BusinessBeneficiary.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent title placement for beneficiary oneOf

The title attributes on lines 11 and 13 are placed as $ref siblings, but PR #221 explicitly moved titles out of $ref siblings and into the schema files themselves because Mintlify's schema resolution was losing $ref-sibling titles. All existing ExternalAccountInfo schemas (BRL, DKK, EUR, etc.) had these sibling titles removed in that PR.

Since CadBeneficiary.yaml is missing its own title: Individual Beneficiary (and BusinessBeneficiary.yaml already has title: Business Beneficiary), the recommended fix is to:

  1. Add title: Individual Beneficiary to CadBeneficiary.yaml
  2. Remove the title siblings here to match the existing pattern:
Suggested change
oneOf:
- title: Individual Beneficiary
$ref: ../common/CadBeneficiary.yaml
- title: Business Beneficiary
$ref: ../common/BusinessBeneficiary.yaml
oneOf:
- $ref: ../common/CadBeneficiary.yaml
- $ref: ../common/BusinessBeneficiary.yaml

The same applies to NgnExternalAccountInfo.yaml.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/CadExternalAccountInfo.yaml
Line: 10-14

Comment:
**Inconsistent title placement for beneficiary `oneOf`**

The `title` attributes on lines 11 and 13 are placed as `$ref` siblings, but PR #221 explicitly moved titles out of `$ref` siblings and into the schema files themselves because Mintlify's schema resolution was losing `$ref`-sibling titles. All existing `ExternalAccountInfo` schemas (BRL, DKK, EUR, etc.) had these sibling titles removed in that PR.

Since `CadBeneficiary.yaml` is missing its own `title: Individual Beneficiary` (and `BusinessBeneficiary.yaml` already has `title: Business Beneficiary`), the recommended fix is to:
1. Add `title: Individual Beneficiary` to `CadBeneficiary.yaml`
2. Remove the `title` siblings here to match the existing pattern:

```suggestion
      oneOf:
      - $ref: ../common/CadBeneficiary.yaml
      - $ref: ../common/BusinessBeneficiary.yaml
```

The same applies to `NgnExternalAccountInfo.yaml`.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 1 to +45
oneOf:
- $ref: ./BrlExternalAccountInfo.yaml
- $ref: ./DkkExternalAccountInfo.yaml
- $ref: ./EurExternalAccountInfo.yaml
- $ref: ./GbpExternalAccountInfo.yaml
- $ref: ./HkdExternalAccountInfo.yaml
- $ref: ./IdrExternalAccountInfo.yaml
- $ref: ./InrExternalAccountInfo.yaml
- $ref: ./MxnExternalAccountInfo.yaml
- $ref: ./MyrExternalAccountInfo.yaml
- $ref: ./PhpExternalAccountInfo.yaml
- $ref: ./SgdExternalAccountInfo.yaml
- $ref: ./ThbExternalAccountInfo.yaml
- $ref: ./UsdExternalAccountInfo.yaml
- $ref: ./VndExternalAccountInfo.yaml
- $ref: ./SparkWalletExternalAccountInfo.yaml
- $ref: ./LightningExternalAccountInfo.yaml
- $ref: ./SolanaWalletExternalAccountInfo.yaml
- $ref: ./TronWalletExternalAccountInfo.yaml
- $ref: ./PolygonWalletExternalAccountInfo.yaml
- $ref: ./BaseWalletExternalAccountInfo.yaml
- title: BRL Account
$ref: ./BrlExternalAccountInfo.yaml
- title: CAD Account
$ref: ./CadExternalAccountInfo.yaml
- title: DKK Account
$ref: ./DkkExternalAccountInfo.yaml
- title: EUR Account
$ref: ./EurExternalAccountInfo.yaml
- title: GBP Account
$ref: ./GbpExternalAccountInfo.yaml
- title: HKD Account
$ref: ./HkdExternalAccountInfo.yaml
- title: IDR Account
$ref: ./IdrExternalAccountInfo.yaml
- title: INR Account
$ref: ./InrExternalAccountInfo.yaml
- title: MXN Account
$ref: ./MxnExternalAccountInfo.yaml
- title: MYR Account
$ref: ./MyrExternalAccountInfo.yaml
- title: NGN Account
$ref: ./NgnExternalAccountInfo.yaml
- title: PHP Account
$ref: ./PhpExternalAccountInfo.yaml
- title: SGD Account
$ref: ./SgdExternalAccountInfo.yaml
- title: THB Account
$ref: ./ThbExternalAccountInfo.yaml
- title: USD Account
$ref: ./UsdExternalAccountInfo.yaml
- title: VND Account
$ref: ./VndExternalAccountInfo.yaml
- title: Spark Wallet
$ref: ./SparkWalletExternalAccountInfo.yaml
- title: Lightning
$ref: ./LightningExternalAccountInfo.yaml
- title: Solana Wallet
$ref: ./SolanaWalletExternalAccountInfo.yaml
- title: Tron Wallet
$ref: ./TronWalletExternalAccountInfo.yaml
- title: Polygon Wallet
$ref: ./PolygonWalletExternalAccountInfo.yaml
- title: Base Wallet
$ref: ./BaseWalletExternalAccountInfo.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-adding title as $ref siblings reverses PR #221 cleanup

PR #221 removed title from $ref siblings in this file and instead placed titles directly in each schema file (e.g., BrlExternalAccountInfo.yaml has title: BRL Account). This was done because Mintlify was losing $ref-sibling titles during schema resolution.

This PR re-adds titles as $ref siblings for all 21 entries, making them redundant with the titles already defined in each schema file. While this likely won't cause a rendering bug at this level (since the schema-level titles are authoritative), it creates duplication and inconsistency with the established pattern. Consider removing the title siblings to keep the file consistent with the approach established in PR #221.

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!

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/external_accounts/ExternalAccountInfoOneOf.yaml
Line: 1-45

Comment:
**Re-adding `title` as `$ref` siblings reverses PR #221 cleanup**

PR #221 removed `title` from `$ref` siblings in this file and instead placed titles directly in each schema file (e.g., `BrlExternalAccountInfo.yaml` has `title: BRL Account`). This was done because Mintlify was losing `$ref`-sibling titles during schema resolution.

This PR re-adds titles as `$ref` siblings for all 21 entries, making them redundant with the titles already defined in each schema file. While this likely won't cause a rendering bug at this level (since the schema-level titles are authoritative), it creates duplication and inconsistency with the established pattern. Consider removing the `title` siblings to keep the file consistent with the approach established in PR #221.

<sub>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!</sub>

How can I resolve this? If you propose a fix, please make it concise.

@AaryamanBhute AaryamanBhute merged commit c172a95 into main Feb 25, 2026
8 checks passed
@AaryamanBhute AaryamanBhute deleted the add-ngn-and-cad branch February 25, 2026 04:31
AaryamanBhute pushed a commit that referenced this pull request Feb 25, 2026
## Summary
- Remove `title:` lines that were siblings to `$ref:` in
`ExternalAccountInfoOneOf.yaml` (22 entries) — these are ignored per the
OpenAPI spec and cause Mintlify to not display titles correctly
- Remove the same `title:/$ref:` sibling pattern from
`CadExternalAccountInfo` and `NgnExternalAccountInfo` beneficiary oneOf
entries (added in #226)
- Add missing `title: Individual Beneficiary` to `CadBeneficiary.yaml`
and `NgnBeneficiary.yaml` so Mintlify renders the oneOf type selector
properly

## Test plan
- [x] `make build` passes
- [x] `make lint` passes (22 pre-existing warnings, 0 errors)
- [ ] Verify Mintlify renders external account info oneOf type selector
with correct labels
- [ ] Verify beneficiary oneOf renders correctly for CAD and NGN
accounts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants