feat: add optional ownershipType to external account schema - #784
feat: add optional ownershipType to external account schema#784shreyav wants to merge 3 commits into
Conversation
Adds an optional `ownershipType` field to `BaseExternalAccountInfo`, backed by a new `OwnershipType` enum with `FIRST_PARTY` and `THIRD_PARTY` values, so external accounts can indicate whether they belong to the customer themselves or to a third party. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GAqqDX3oY33G7LcHNv5T2J
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-typescript studio · code · diff
✅ grid-openapi studio · code · diff
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Greptile SummaryAdds an optional external-account ownership classification throughout the API contract.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The new optional property follows existing schema conventions, resolves through the shared external-account composition hierarchy, and is represented consistently in both generated bundles.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/external_accounts/OwnershipType.yaml | Defines a valid string enum for first- and third-party external-account ownership. |
| openapi/components/schemas/external_accounts/BaseExternalAccountInfo.yaml | Adds the ownership classification as an optional property inherited by external-account create and response schemas. |
| openapi.yaml | Correctly bundles the new component and shared optional property. |
| mintlify/openapi.yaml | Remains consistent with the root bundled OpenAPI artifact. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
O[OwnershipType enum] --> B[BaseExternalAccountInfo]
B --> C[External-account create schemas]
B --> R[External-account response schemas]
C --> S[Bundled OpenAPI and generated SDK inputs]
R --> S
Reviews (1): Last reviewed commit: "feat: add optional ownershipType to exte..." | Re-trigger Greptile
…eateRequest Relocate the optional ownershipType field from BaseExternalAccountInfo (inside the accountInfo oneOf) to the top-level ExternalAccount resource and ExternalAccountCreateRequest, alongside the other resource-level fields like customerId and currency. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GAqqDX3oY33G7LcHNv5T2J
Make ownershipType settable on platform-owned external account creation as well, matching ExternalAccountCreateRequest. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GAqqDX3oY33G7LcHNv5T2J
|
Is the main reason to put this top-level just because we don't have a base crypto wallet account type? This is currently only needed for crypto wallets, right? Do you anticipate it might be used or needed for some fiat rails too? Also, how will people know when this is required or not? Should we add something to docs or the field desription? |
we do have a base but for some reason I couldn't figure out all the other fields are at this level and only the discriminator is on the base, so i put it here for consistency -- I don't feel strongly about it and can change it if you do. We also need for fiat in some cases, will share context offline I haven't figure out exactly when its required yet, will update the description when I do |
Adds an optional
ownershipTypefield to the external account resource, so external accounts can indicate whether they belong to the customer themselves (FIRST_PARTY) or to a third party (THIRD_PARTY).Changes
openapi/components/schemas/external_accounts/OwnershipType.yamlwith valuesFIRST_PARTYandTHIRD_PARTY.ExternalAccount.yaml: adds an optional top-levelownershipTypeproperty, alongside the other resource-level fields (customerId,currency,platformAccountId, ...).ExternalAccountCreateRequest.yamlandPlatformExternalAccountCreateRequest.yaml: add the same optionalownershipTypeproperty so it can be set at creation time for both customer and platform-owned accounts.openapi.yamlandmintlify/openapi.yamlviamake build.The field lives on the resource envelope rather than inside the per-rail
accountInfopayloads, matching where the other account-level metadata sits. It is optional, so this is backwards compatible andinfo.versionis unchanged.Testing
make build— bundles cleanly.npx @redocly/cli lint openapi.yaml— valid (warnings only, all pre-existing).Note: the
npx spectral lintstep ofmake lintfails in this environment because thespectralbinary isn't resolvable, andmake lint-markdownfails becausepackage.jsonhas nolint:markdownscript. Both are pre-existing and unrelated to this change.