Conversation
Greptile SummaryThis PR adds comprehensive idempotency documentation and OpenAPI spec support for the quotes endpoints. It adds an "Idempotency" section to Key changes:
Minor notes:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| openapi/README.md | Adds a new "Idempotency" section with endpoint table, behavior explanation, and SDK examples. Documentation is accurate and well-structured; minor gap in SDK examples for the POST /quotes (create) path. |
| openapi/paths/quotes/quotes.yaml | Adds the Idempotency-Key header parameter to POST /quotes; structurally correct but uses a placeholder <uuid> example value instead of a real UUID. |
| openapi/paths/quotes/quotes_{quoteId}_execute.yaml | Adds the Idempotency-Key header parameter to POST /quotes/{quoteId}/execute; structurally correct, same <uuid> placeholder issue as quotes.yaml. |
| openapi.yaml | Compiled spec updated to add Idempotency-Key to POST /quotes and POST /quotes/{quoteId}/execute; mirrors the individual YAML changes, same placeholder example issue. |
| mintlify/openapi.yaml | Mintlify-specific compiled spec updated identically to openapi.yaml; same changes and same placeholder issue. |
Sequence Diagram
sequenceDiagram
participant Client
participant Server
Note over Client,Server: First request (with idempotency header)
Client->>Server: POST /quotes/{quoteId}/execute
Server->>Server: Process and store response
Server-->>Client: 200 OK
Note over Client,Server: Retry with same header value
Client->>Server: POST /quotes/{quoteId}/execute
Server-->>Client: Cached 200 OK (no reprocessing)
Note over Client,Server: 5xx responses are not cached
Client->>Server: POST /quotes/{quoteId}/execute
Server->>Server: Re-process request
Server-->>Client: Fresh response
Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi/paths/quotes/quotes.yaml
Line: 43
Comment:
**`<uuid>` placeholder vs actual UUID example**
The `example` value `<uuid>` is a descriptive placeholder, not a valid UUID string. The existing `transfer_in.yaml` and `transfer_out.yaml` both use a real UUID string as the example value. Using an actual UUID here would be more consistent and produce better documentation and SDK snippets via Stainless.
The same issue is present in `openapi/paths/quotes/quotes_{quoteId}_execute.yaml` (line 32), as well as both copies of the compiled spec (`openapi.yaml` and `mintlify/openapi.yaml`).
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: openapi/README.md
Line: 603-607
Comment:
**TypeScript example only covers `execute`, not `POST /quotes`**
The README table lists `POST /quotes` (with `immediatelyExecute: true`) as one of the endpoints that *requires* idempotency, but the "SDK Support" section only shows a code example for `quotes.execute`. Since `POST /quotes` has a request body, the idempotency key belongs in the separate request-options argument (second parameter for Stainless-generated SDKs when there is a body), so the usage pattern differs meaningfully from `execute`.
A developer following only these examples may not know how to pass the key for the `create` call. Consider adding a complementary TypeScript snippet alongside the existing one showing the pattern for `client.quotes.create(...body, { idempotencyKey: ... })`.
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 57e1179
b5b7078 to
57e1179
Compare
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-python studio · code · diff
✅ grid-typescript studio · code · diff
⏳ These are partial results; builds are still running. This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
| ```typescript | ||
| // TypeScript | ||
| await client.quotes.execute('Quote:123', { | ||
| idempotencyKey: '550e8400-e29b-41d4-a716-446655440000', | ||
| }); |
There was a problem hiding this comment.
TypeScript example only covers execute, not POST /quotes
The README table lists POST /quotes (with immediatelyExecute: true) as one of the endpoints that requires idempotency, but the "SDK Support" section only shows a code example for quotes.execute. Since POST /quotes has a request body, the idempotency key belongs in the separate request-options argument (second parameter for Stainless-generated SDKs when there is a body), so the usage pattern differs meaningfully from execute.
A developer following only these examples may not know how to pass the key for the create call. Consider adding a complementary TypeScript snippet alongside the existing one showing the pattern for client.quotes.create(...body, { idempotencyKey: ... }).
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/README.md
Line: 603-607
Comment:
**TypeScript example only covers `execute`, not `POST /quotes`**
The README table lists `POST /quotes` (with `immediatelyExecute: true`) as one of the endpoints that *requires* idempotency, but the "SDK Support" section only shows a code example for `quotes.execute`. Since `POST /quotes` has a request body, the idempotency key belongs in the separate request-options argument (second parameter for Stainless-generated SDKs when there is a body), so the usage pattern differs meaningfully from `execute`.
A developer following only these examples may not know how to pass the key for the `create` call. Consider adding a complementary TypeScript snippet alongside the existing one showing the pattern for `client.quotes.create(...body, { idempotencyKey: ... })`.
How can I resolve this? If you propose a fix, please make it concise.
TL;DR
Added comprehensive idempotency documentation to the OpenAPI README, covering requirements for money movement endpoints, implementation details, and SDK usage examples.
What changed?
Added a new "Idempotency" section to the OpenAPI README that includes:
POST /quoteswithimmediatelyExecute: true,POST /quotes/{quoteId}/execute,POST /transfer-in,POST /transfer-out)How to test?
Review the documentation for accuracy and completeness. Verify that the listed endpoints and SDK examples align with the actual API implementation and SDK interfaces.
Why make this change?
This documentation ensures developers understand how to properly implement idempotency for financial operations, preventing duplicate transactions that could occur due to retries, network failures, or client timeouts. Clear guidelines also help maintain consistency when adding new money movement endpoints.