chore(stainless): bump edition, sync resources, fix webhook discrimination#525
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Greptile SummaryThis PR updates
Confidence Score: 4/5Safe to merge; the change only affects SDK code generation config and does not touch runtime API logic. The change is straightforward configuration following established patterns in the file. The one open question is whether the discriminated-union sub-types need explicit model entries to be surfaced in the generated SDK — comparable resources list them explicitly, but this may be intentional or Stainless may resolve them automatically. .stainless/stainless.yml — specifically the new
|
| Filename | Overview |
|---|---|
| .stainless/stainless.yml | Expands the documents resource: adds body_param_name to upload and replace methods, and adds a models section exposing five schemas. Sub-type variants of the oneOf request schemas are not listed, which differs from the pattern used in other resources like auth.credentials. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Stainless SDK Generator] --> B[documents resource]
B --> C[Methods]
B --> D[Models]
C --> C1["upload (POST /documents)\nbody_param_name: DocumentUploadRequest"]
C --> C4["replace (PUT /documents/{id})\nbody_param_name: DocumentReplaceRequest"]
D --> D1[Document]
D --> D2[DocumentListResponse]
D --> D3[DocumentType]
D --> D4[DocumentUploadRequest]
D --> D5[DocumentReplaceRequest]
D4 -. oneOf .-> D4a[IdentityDocumentUploadRequest]
D4 -. oneOf .-> D4b[NonIdentityDocumentUploadRequest]
D5 -. oneOf .-> D5a[IdentityDocumentReplaceRequest]
D5 -. oneOf .-> D5b[NonIdentityDocumentReplaceRequest]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
.stainless/stainless.yml:475-480
**Missing oneOf sub-type models for request schemas**
`DocumentUploadRequest` and `DocumentReplaceRequest` are discriminated `oneOf` schemas — their actual concrete variants are `IdentityDocumentUploadRequest` / `NonIdentityDocumentUploadRequest` and `IdentityDocumentReplaceRequest` / `NonIdentityDocumentReplaceRequest`. The comparable `auth.credentials` resource explicitly lists all union variants (e.g. `email_otp_credential_create_request`, `passkey_credential_create_request`, `oauth_credential_create_request`). Without listing the variants here, generated SDK consumers may not have access to the concrete types they need to construct a valid request body — they'd only see the opaque top-level union. Consider adding `identity_document_upload_request`, `non_identity_document_upload_request`, `identity_document_replace_request`, `non_identity_document_replace_request`, `identity_document_type`, and `non_identity_document_type` to this `models` block, or confirm that Stainless resolves sub-types automatically for discriminated unions.
Reviews (1): Last reviewed commit: "chore(stainless): expose document models..." | Re-trigger Greptile
| models: | ||
| document: "#/components/schemas/Document" | ||
| document_list_response: "#/components/schemas/DocumentListResponse" | ||
| document_type: "#/components/schemas/DocumentType" | ||
| document_upload_request: "#/components/schemas/DocumentUploadRequest" | ||
| document_replace_request: "#/components/schemas/DocumentReplaceRequest" |
There was a problem hiding this comment.
Missing oneOf sub-type models for request schemas
DocumentUploadRequest and DocumentReplaceRequest are discriminated oneOf schemas — their actual concrete variants are IdentityDocumentUploadRequest / NonIdentityDocumentUploadRequest and IdentityDocumentReplaceRequest / NonIdentityDocumentReplaceRequest. The comparable auth.credentials resource explicitly lists all union variants (e.g. email_otp_credential_create_request, passkey_credential_create_request, oauth_credential_create_request). Without listing the variants here, generated SDK consumers may not have access to the concrete types they need to construct a valid request body — they'd only see the opaque top-level union. Consider adding identity_document_upload_request, non_identity_document_upload_request, identity_document_replace_request, non_identity_document_replace_request, identity_document_type, and non_identity_document_type to this models block, or confirm that Stainless resolves sub-types automatically for discriminated unions.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .stainless/stainless.yml
Line: 475-480
Comment:
**Missing oneOf sub-type models for request schemas**
`DocumentUploadRequest` and `DocumentReplaceRequest` are discriminated `oneOf` schemas — their actual concrete variants are `IdentityDocumentUploadRequest` / `NonIdentityDocumentUploadRequest` and `IdentityDocumentReplaceRequest` / `NonIdentityDocumentReplaceRequest`. The comparable `auth.credentials` resource explicitly lists all union variants (e.g. `email_otp_credential_create_request`, `passkey_credential_create_request`, `oauth_credential_create_request`). Without listing the variants here, generated SDK consumers may not have access to the concrete types they need to construct a valid request body — they'd only see the opaque top-level union. Consider adding `identity_document_upload_request`, `non_identity_document_upload_request`, `identity_document_replace_request`, `non_identity_document_replace_request`, `identity_document_type`, and `non_identity_document_type` to this `models` block, or confirm that Stainless resolves sub-types automatically for discriminated unions.
How can I resolve this? If you propose a fix, please make it concise.c072600 to
aeca0f5
Compare
aeca0f5 to
a111ae8
Compare
a111ae8 to
c031718
Compare
c031718 to
bd0bc88
Compare
bd0bc88 to
6393370
Compare
6393370 to
8080538
Compare
bd7bf74 to
6d31e9c
Compare
8080538 to
98f05d1
Compare
98f05d1 to
4245cd6
Compare
4245cd6 to
1410aee
Compare
dc08535 to
4cc01d1
Compare
1410aee to
884ca72
Compare
There was a problem hiding this comment.
884ca72 is a pure rebase onto 4cc01d1. Approving based on @AaryamanBhute's previous approval of 1410aee.
There was a problem hiding this comment.
884ca72 is a pure rebase onto 4cc01d1. Approving based on @AaryamanBhute's previous approval of 1410aee.
4cc01d1 to
d9e464f
Compare
884ca72 to
73bb1e6
Compare
There was a problem hiding this comment.
73bb1e6 is a pure rebase onto d9e464f. Approving based on @AaryamanBhute's previous approval of 1410aee.
There was a problem hiding this comment.
73bb1e6 is a pure rebase onto d9e464f. Approving based on @AaryamanBhute's previous approval of 1410aee.
The base branch was changed.
73bb1e6 to
5db6f8a
Compare
There was a problem hiding this comment.
73bb1e6 is a pure rebase onto d9e464f. Approving based on @AaryamanBhute's previous approval of 1410aee.
There was a problem hiding this comment.
5db6f8a is a pure rebase onto d9e464f. Approving based on @AaryamanBhute's previous approval of 1410aee.

Summary
Bumps the Stainless edition and syncs several resource definitions to match the current API surface and codegen needs.
Edition
edition: 2025-10-10→2026-05-06.kotlin.2025-10-08edition; the new root edition covers it.Webhook discrimination
webhooks.unwrap: adddiscriminator: typeso the unwrap codegen dispatches on the payload'stypefield.openapi.transformsentry: striptypefromBaseWebhook.propertiesandBaseWebhook.required. Without this, every generated*WebhookEventcarries the fullWebhookTypeenum on itstypefield viaBaseWebhook, defeating the discriminator — variants that share the samedatashape (e.g. multiple Card-related webhooks) become indistinguishable and the deserializer picks the first one declared. Same pattern already applied to customer / account / source / destination / auth base schemas in this file.Card refund (Kotlin keyword fix carry-over)
refund: post /sandbox/cards/{id}/simulate/return(the method key was renamed fromreturnin fix(stainless): rename simulate.return → simulate.refund to avoid Kotlin keyword #520 to avoid the Kotlin reserved keyword; preserved here through the edition bump).Resource cleanup —
customerscustomers.modelsblock. Customer / kyc / internal-account types are now exposed via$shared.modelsand resource subresources directly.create_kyc_linkmethod definition; the API surface is covered bygenerate_kyc_link(renamed earlier in chore(stainless): add ruby/go/csharp/php/cli targets and sync resources #518).update_internal_accountto the short form (thebody_param_namewas redundant).Resource cleanup —
authauth_sessionmodel alias fromsessions→credentials(the canonical location for credential-related types).*CredentialCreateRequest/*CredentialVerifyRequestmodel aliases (email_otp_*,oauth_*,passkey_*) for the verify side. Stainless collapses these schemas to theirFieldssiblings after the existingtype-strip transforms; exposing the wrapper aliases generated broken imports in the TS SDK (TS2724/TS2552). See chore(stainless): add ruby/go/csharp/php/cli targets and sync resources #518 for the original diagnosis.auth_session_refresh_requestand the explicitbody_param_nameonsessions.refresh; covered by the new edition's defaults.New
$sharedmodelsSurface a few schemas that consumers need to reference directly:
individual_customer,business_customer,beneficial_owner,business_info_update,swift_beneficiaryagentsagent_account_rulemodel alias.Stack
Stacked on top of #521.