Skip to content

fix(stainless): rename simulate.return → simulate.refund to avoid Kotlin keyword#520

Open
pengying wants to merge 1 commit into
mainfrom
05-27-fix_stainless_rename_simulate.return_simulate.refund_to_avoid_kotlin_keyword
Open

fix(stainless): rename simulate.return → simulate.refund to avoid Kotlin keyword#520
pengying wants to merge 1 commit into
mainfrom
05-27-fix_stainless_rename_simulate.return_simulate.refund_to_avoid_kotlin_keyword

Conversation

@pengying
Copy link
Copy Markdown
Contributor

@pengying pengying commented May 28, 2026

Summary

Renames the Stainless method sandbox.cards.simulate.returnsandbox.cards.simulate.refund to avoid the Kotlin reserved keyword return.

Why

After #518, Stainless codegen emits a warning:

Encountered name return that conflicts with a Kotlin keyword. Renamed to return_.

That gives consumers awkward call sites like grid.sandbox.cards.simulate.return_(...) in Kotlin. The endpoint creates a CardRefund (per the POST /sandbox/cards/{id}/simulate/return description: "Simulate a merchant-initiated RETURN against an existing settled card transaction... Creates a CardRefund..."), so refund is both semantically accurate and reads cleanly across all SDK targets.

Changes

  • .stainless/stainless.yml: rename the method key in sandbox.subresources.cards.subresources.simulate.methods from returnrefund. The underlying OpenAPI path is unchanged (/sandbox/cards/{id}/simulate/return); only the SDK identifier changes.

SDK call site impact

Language Before After
Kotlin simulate.return_(...) simulate.refund(...)
TypeScript simulate.return(...) simulate.refund(...)
Python simulate.return_(...) (reserved) simulate.refund(...)

Method has not shipped in any GA SDK yet, so no compatibility shim is needed.

Test plan

  • Stainless regen succeeds without the keyword-conflict warning
  • Kotlin SDK compiles

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

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

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment May 28, 2026 5:15am

Request Review

Copy link
Copy Markdown
Contributor Author

pengying commented May 28, 2026

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile Summary

This PR renames the Stainless SDK method alias simulate.return to simulate.refund to avoid a conflict with the return reserved keyword in Kotlin. The underlying HTTP endpoint path (/sandbox/cards/{id}/simulate/return) is unchanged — only the generated SDK method name is affected.

  • The rename is consistent with the existing card_refund_summary model name already present in the same config block, making the naming cohesive across the resource.
  • No other files are affected; the change is isolated to a single line in .stainless/stainless.yml.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "fix(stainless): rename simulate.return →..." | Re-trigger Greptile

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