add total fees to exchange rate api#575
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
✅ grid-typescript studio · code
|
Greptile SummaryAdds a
Confidence Score: 4/5Safe to merge — additive schema change with no breaking modifications to existing fields. The change is purely additive: a new optional field on an existing response schema. Both generated bundles are in sync with the source. The only thing worth addressing before publishing is the schema-level example for openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml — the
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml | Adds total field to ExchangeRateFees schema; schema example value (100) equals the fixed fee example, which may mislead consumers about variable fee components |
| openapi/paths/exchange-rates/exchange_rates.yaml | Adds total values to both response examples (150 for USD→INR, 15 for USD→EUR); values are consistently greater than fixed, which correctly illustrates the variable component |
| openapi.yaml | Generated bundle file — changes are identical to the source edits, indicating make build was run correctly |
| mintlify/openapi.yaml | Generated Mintlify bundle — mirrors the main openapi.yaml changes as expected from a make build run |
Sequence Diagram
sequenceDiagram
participant Client
participant GridAPI as Grid API
Client->>GridAPI: "GET /exchange-rates?sourceCurrency=USD&sendingAmount=10000"
GridAPI-->>Client: 200 OK
note over Client,GridAPI: ExchangeRate object
Client->>Client: "fees.fixed = 100 (fixed fee, cents)"
Client->>Client: "fees.total = 150 (fixed + variable, cents) - varies with sendingAmount"
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
openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml:10-18
The `example` value for `total` is `100`, identical to the `fixed` fee example. Since `total` is meant to capture fixed + any variable/percentage component, an example where they are equal implies there is never a variable fee, which contradicts the response examples in the path file (where total is `150` vs fixed `100`, or `15` vs `10`). Using `150` here aligns with the live example and signals clearly to API consumers that total can exceed fixed.
```suggestion
total:
type: integer
format: int64
description: >-
Total fees in the smallest unit of the sending currency (e.g., cents for
USD). This value may change depending on the sending amount used; if no
sending amount is specified, it falls back to the default.
minimum: 0
example: 150
```
Reviews (1): Last reviewed commit: "add total fees to exchange rate api" | Re-trigger Greptile
| total: | ||
| type: integer | ||
| format: int64 | ||
| description: >- | ||
| Total fees in the smallest unit of the sending currency (e.g., cents for | ||
| USD). This value may change depending on the sending amount used; if no | ||
| sending amount is specified, it falls back to the default. | ||
| minimum: 0 | ||
| example: 100 |
There was a problem hiding this comment.
The
example value for total is 100, identical to the fixed fee example. Since total is meant to capture fixed + any variable/percentage component, an example where they are equal implies there is never a variable fee, which contradicts the response examples in the path file (where total is 150 vs fixed 100, or 15 vs 10). Using 150 here aligns with the live example and signals clearly to API consumers that total can exceed fixed.
| total: | |
| type: integer | |
| format: int64 | |
| description: >- | |
| Total fees in the smallest unit of the sending currency (e.g., cents for | |
| USD). This value may change depending on the sending amount used; if no | |
| sending amount is specified, it falls back to the default. | |
| minimum: 0 | |
| example: 100 | |
| total: | |
| type: integer | |
| format: int64 | |
| description: >- | |
| Total fees in the smallest unit of the sending currency (e.g., cents for | |
| USD). This value may change depending on the sending amount used; if no | |
| sending amount is specified, it falls back to the default. | |
| minimum: 0 | |
| example: 150 |
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/exchange_rates/ExchangeRateFees.yaml
Line: 10-18
Comment:
The `example` value for `total` is `100`, identical to the `fixed` fee example. Since `total` is meant to capture fixed + any variable/percentage component, an example where they are equal implies there is never a variable fee, which contradicts the response examples in the path file (where total is `150` vs fixed `100`, or `15` vs `10`). Using `150` here aligns with the live example and signals clearly to API consumers that total can exceed fixed.
```suggestion
total:
type: integer
format: int64
description: >-
Total fees in the smallest unit of the sending currency (e.g., cents for
USD). This value may change depending on the sending amount used; if no
sending amount is specified, it falls back to the default.
minimum: 0
example: 150
```
How can I resolve this? If you propose a fix, please make it concise.
No description provided.