Skip to content

Add CnyExternalAccountCreateInfo + register in CreateInfo OneOf#552

Open
mohamedwane wants to merge 1 commit into
mainfrom
mohamed/add-cny-external-account-create-info
Open

Add CnyExternalAccountCreateInfo + register in CreateInfo OneOf#552
mohamedwane wants to merge 1 commit into
mainfrom
mohamed/add-cny-external-account-create-info

Conversation

@mohamedwane
Copy link
Copy Markdown
Contributor

Summary

  • Adds the missing CnyExternalAccountCreateInfo.yaml (hand-authored, mirrors the existing BdtExternalAccountCreateInfo.yaml template) and registers it in ExternalAccountCreateInfoOneOf.yaml.
  • The auto-sync workflow's create_external_accounts.py only generates the read-side {Currency}ExternalAccountInfo.yaml; the create-side {Currency}ExternalAccountCreateInfo.yaml is hand-authored per corridor and was missed when CNY landed via chore: Sync account schemas #551. Without the create variant in the OneOf, the discriminator can't dispatch accountType: CNY_ACCOUNT on POST /customers/external-accounts and the request fails with "did not match any expected shape".

Test plan

  • npm run build:openapi produces a bundle that contains CnyExternalAccountCreateInfo (line 15259 in the regenerated openapi.yaml).
  • After merge, regen the downstream sparkcore mirror via update_schema.sh and confirm grid_api/models/cny_external_account_create_info.py exists.
  • Once mirror regen lands in sparkcore, EGP-style CNY create payload accepts.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jun 5, 2026 2:27am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

✱ Stainless preview builds for grid

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

cli

chore(internal): regenerate SDK with no functional changes

csharp

feat(api): add cny account support to agents/customers/platform external accounts

go

feat(api): add CNY account support to customer/platform external account creation

kotlin

feat(api): add CNY account support to external accounts

openapi

feat(api): add CNY account support to external accounts

php

feat(api): add CNY account type to external accounts

python

feat(api): add CNY account support to external_account parameters

ruby

feat(api): add CNY account type to external accounts

typescript

feat(api): add CNY_ACCOUNT support to external accounts

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-openapi studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅

New diagnostics (2 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`
grid-ruby studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅build ✅lint ✅test ✅

New diagnostics (2 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`
grid-go studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@4ba7d95a337c480622c543bfe3a69bfe90dcc6df
New diagnostics (2 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`
⚠️ grid-kotlin studio · code · diff

Your SDK build had a failure in the test CI job, which is a regression from the base state.
generate ✅build ✅lint ✅test ❗ (prev: test ✅)

New diagnostics (2 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`
grid-python studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅build ✅lint ❗test ❗

pip install https://pkg.stainless.com/s/grid-python/d1d6603a5a3bfca46abd95cc84eb349c5bb0b81b/grid-0.0.1-py3-none-any.whl
New diagnostics (2 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`
grid-csharp studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️build ❗lint ✅test ❗

New diagnostics (3 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`
💡 Name/Renamed: 260 names were renamed due to language constraints, so fallback names will be used instead.
grid-typescript studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅build ✅lint ✅test ✅

npm install https://pkg.stainless.com/s/grid-typescript/ca0d74be91688ae84b26c453c52886eff1f1c8a8/dist.tar.gz
New diagnostics (2 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`
grid-php studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅lint ✅test ✅

New diagnostics (2 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`
grid-cli studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️build ❗lint ❗test ❗

New diagnostics (2 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyExternalAccountCreateInfo`
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/CnyBeneficiary`

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-06-05 02:33:26 UTC

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 5, 2026

Greptile Summary

This PR adds the missing CnyExternalAccountCreateInfo.yaml create-side schema and registers it in ExternalAccountCreateInfoOneOf.yaml, fixing POST /customers/external-accounts requests with accountType: CNY_ACCOUNT that previously failed discriminator dispatch.

  • New schema (CnyExternalAccountCreateInfo.yaml): correctly mirrors the BdtExternalAccountCreateInfo.yaml template, composing BaseExternalAccountInfo, CnyAccountInfoBase, and a beneficiary oneOf with CnyBeneficiary/BusinessBeneficiary — all referenced schemas exist and resolve.
  • OneOf registration (ExternalAccountCreateInfoOneOf.yaml): CnyExternalAccountCreateInfo added to both the oneOf array and the discriminator.mapping block (the prior review's missing-mapping issue is resolved in this revision).
  • Bundled files (openapi.yaml, mintlify/openapi.yaml): regenerated to reflect the new schema.

Confidence Score: 5/5

Safe to merge — adds a well-scoped, missing schema file and its OneOf registration with no changes to existing entries.

The change is additive only: a new YAML file and two new lines in the OneOf registration. All $ref targets exist and resolve. The discriminator mapping entry is present and alphabetically ordered. No existing schemas or endpoints are modified.

No files require special attention.

Important Files Changed

Filename Overview
openapi/components/schemas/external_accounts/CnyExternalAccountCreateInfo.yaml New CNY create-side schema, correctly mirrors BdtExternalAccountCreateInfo.yaml with CNY-specific refs; all referenced schemas exist and resolve
openapi/components/schemas/external_accounts/ExternalAccountCreateInfoOneOf.yaml Adds CnyExternalAccountCreateInfo to both the oneOf array and the discriminator.mapping block; CNY_ACCOUNT entry correctly placed alphabetically
openapi.yaml Regenerated bundle reflecting the new CnyExternalAccountCreateInfo schema and OneOf registration
mintlify/openapi.yaml Mintlify bundle regenerated to include CnyExternalAccountCreateInfo for docs

Sequence Diagram

sequenceDiagram
    participant Client
    participant API as POST /customers/external-accounts
    participant Discriminator as ExternalAccountCreateInfoOneOf
    participant Schema as CnyExternalAccountCreateInfo

    Client->>API: "{ accountType: "CNY_ACCOUNT", ... }"
    API->>Discriminator: resolve oneOf via discriminator
    Discriminator->>Schema: "mapping["CNY_ACCOUNT"] -> CnyExternalAccountCreateInfo.yaml"
    Schema->>Schema: "allOf [BaseExternalAccountInfo, CnyAccountInfoBase, {beneficiary}]"
    Schema-->>API: validated
    API-->>Client: 200 OK
Loading

Reviews (2): Last reviewed commit: "Add CnyExternalAccountCreateInfo + regis..." | Re-trigger Greptile

The auto-sync workflow's create_external_accounts.py only generates
the read-side `{Currency}ExternalAccountInfo.yaml`; the create-side
`{Currency}ExternalAccountCreateInfo.yaml` is hand-authored per
corridor and was missed when CNY landed via #551. Without the Create
variant in `ExternalAccountCreateInfoOneOf`, the discriminator can't
dispatch `accountType: CNY_ACCOUNT` on POST /customers/external-
accounts and the request fails with "did not match any expected shape".

This adds the missing schema (mirroring the existing
BdtExternalAccountCreateInfo template) and inserts the $ref in the
CreateInfoOneOf alphabetically between Cad and Cop.
@mohamedwane mohamedwane force-pushed the mohamed/add-cny-external-account-create-info branch from 519bcee to 4451e8b Compare June 5, 2026 02:27
@mohamedwane
Copy link
Copy Markdown
Contributor Author

Good catch — fixed in 4451e8b. Added CNY_ACCOUNT: ./CnyExternalAccountCreateInfo.yaml to the discriminator.mapping block (between CAD_ACCOUNT and COP_ACCOUNT) and re-ran npm run build:openapi. The bundled openapi.yaml now carries CNY_ACCOUNT: '#/components/schemas/CnyExternalAccountCreateInfo' in the mapping. Also verified the read-side ExternalAccountInfoOneOf.yaml already had the matching CNY_ACCOUNT entry (auto-synced via #551), so this PR closes the gap on the create side.

@mohamedwane mohamedwane enabled auto-merge (squash) June 5, 2026 02:37
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.

1 participant