fix(stainless): rename simulate.return → simulate.refund to avoid Kotlin keyword#520
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Greptile SummaryThis PR renames the Stainless SDK method alias
Confidence Score: 5/5Safe to merge — one-line rename in the Stainless config with no changes to the HTTP endpoint or any application logic. The change is a single alias rename in stainless.yml. The HTTP path is preserved, the new name aligns with the existing card_refund_summary model, and there is no risk of breaking existing API consumers — only generated SDK method names change. No files require special attention.
|
| Filename | Overview |
|---|---|
| .stainless/stainless.yml | Renames the simulate.return method alias to simulate.refund in the Stainless SDK config while keeping the underlying HTTP path unchanged; consistent with the existing card_refund_summary model name. |
Sequence Diagram
sequenceDiagram
participant KotlinSDK as Kotlin SDK Client
participant StainlessGen as Stainless SDK Generator
participant API as Grid API
Note over StainlessGen: stainless.yml: refund → /simulate/return
KotlinSDK->>StainlessGen: sandbox.cards.simulate.refund(id)
StainlessGen->>API: "POST /sandbox/cards/{id}/simulate/return"
API-->>StainlessGen: 200 OK (CardRefundSummary)
StainlessGen-->>KotlinSDK: CardRefundSummary
Reviews (1): Last reviewed commit: "fix(stainless): rename simulate.return →..." | Re-trigger Greptile

Summary
Renames the Stainless method
sandbox.cards.simulate.return→sandbox.cards.simulate.refundto avoid the Kotlin reserved keywordreturn.Why
After #518, Stainless codegen emits a warning:
That gives consumers awkward call sites like
grid.sandbox.cards.simulate.return_(...)in Kotlin. The endpoint creates aCardRefund(per thePOST /sandbox/cards/{id}/simulate/returndescription: "Simulate a merchant-initiated RETURN against an existing settled card transaction... Creates a CardRefund..."), sorefundis both semantically accurate and reads cleanly across all SDK targets.Changes
.stainless/stainless.yml: rename the method key insandbox.subresources.cards.subresources.simulate.methodsfromreturn→refund. The underlying OpenAPI path is unchanged (/sandbox/cards/{id}/simulate/return); only the SDK identifier changes.SDK call site impact
simulate.return_(...)simulate.refund(...)simulate.return(...)simulate.refund(...)simulate.return_(...)(reserved)simulate.refund(...)Method has not shipped in any GA SDK yet, so no compatibility shim is needed.
Test plan