-
Notifications
You must be signed in to change notification settings - Fork 199
feat(api): add credit purchase idempotency key #4592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -193,6 +193,15 @@ model CreditGrant { | |||||||||||||||||||||||
| @visibility(Lifecycle.Create) | ||||||||||||||||||||||||
| expires_after?: Shared.ISO8601Duration; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||
| * Idempotency key for the credit grant creation request. | ||||||||||||||||||||||||
| * | ||||||||||||||||||||||||
| * When provided, reusing the same key returns an HTTP 409 Conflict instead of | ||||||||||||||||||||||||
| * creating a duplicate grant, which makes create requests safe to retry. | ||||||||||||||||||||||||
|
Comment on lines
+196
to
+200
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Clarify the idempotency scope in the docs. The wording reads like any key reuse returns ✏️ Suggested wording- * When provided, reusing the same key returns an HTTP 409 Conflict instead of
- * creating a duplicate grant, which makes create requests safe to retry.
+ * When provided, reusing the same key for the same customer returns an HTTP 409
+ * Conflict instead of creating a duplicate grant, which makes create requests
+ * safe to retry.As per path instructions, "The declared API should be accurate, in parity with the actual implementation, and easy to understand." 📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Path instructions |
||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||
| @visibility(Lifecycle.Create) | ||||||||||||||||||||||||
| key?: Shared.ExternalResourceKey; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||
| * The timestamp when the credit grant expires. | ||||||||||||||||||||||||
| * | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server treats
keyas create-only, but the generated TypeScript response model still exposes it onCreditGrant. The OpenAPI response schema and Go response conversion do not serialize this field, so TS callers of create/get/list can readCreditGrant.keyfrom the SDK type and always receiveundefinedat runtime. Please keep the field onCreateCreditGrantRequestonly, or update the response contract and serializer to return it consistently.Context Used: api/spec/AGENTS.md (source)
Prompt To Fix With AI