docs(openapi): correct exchangeRate example to match documented basis (PROD-54)#631
Conversation
… (PROD-54) The exchangeRate field on the /exchange-rates ExchangeRate schema is documented as 'Number of sending currency units per receiving currency unit', but the examples showed destination-per-source values (USD->INR 82.50, USD->EUR 0.925), the inverse of both the field description and the live API. Correct the examples to the documented basis (sending units per receiving unit) and keep each response example internally consistent with its sendingAmount and receivingAmount: USD->INR 0.012121 (= 1/82.50, $100 -> 8250 INR), USD->EUR 1.081081 (= 1/0.925, $100 -> 92.50 EUR, receivingAmount 18500 -> 9250).
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript ✅ grid-ruby studio · code
|
Greptile SummaryThis PR corrects the
Confidence Score: 5/5Docs-only example corrections with no runtime code changes; safe to merge. All three corrected example values are mathematically consistent with the unchanged sendingAmount: 10000 and the field description. The two regenerated bundle files (openapi.yaml, mintlify/openapi.yaml) are identical to each other and to the source changes, confirming a clean make build run. No schema types, constraints, or API behaviour are touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/exchange_rates/ExchangeRate.yaml | Corrects the exchangeRate schema-level example from 82.50 (INR-per-USD, inverse basis) to 0.012121 (USD-per-INR, matching the field description). |
| openapi/paths/exchange-rates/exchange_rates.yaml | Updates both USD→INR and USD→EUR response examples to use the correct exchangeRate basis; also corrects receivingAmount in the EUR example from 18500 to 9250 for internal consistency. |
| openapi.yaml | Regenerated bundle — contains the same three example value corrections as the source YAML files; changes are mechanically consistent with the source. |
| mintlify/openapi.yaml | Regenerated Mintlify bundle — identical corrections to openapi.yaml; confirms make build produced consistent output across both bundle targets. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["exchangeRate definition\n'Number of sending currency units\nper receiving currency unit'"] --> B{Corridor}
B --> C["USD → INR\nsendingAmount: 10000 ¢\n($100)"]
B --> D["USD → EUR\nsendingAmount: 10000 ¢\n($100)"]
C --> E["exchangeRate = 0.012121\n(1 INR costs 0.012121 USD)\nreceivingAmount = 10000 / 0.012121\n≈ 825,000 paise (₹8,250) ✓"]
D --> F["exchangeRate = 1.081081\n(1 EUR costs 1.081081 USD)\nreceivingAmount = 10000 / 1.081081\n≈ 9,250 cents (€92.50) ✓"]
style A fill:#dbeafe,stroke:#3b82f6
style E fill:#dcfce7,stroke:#16a34a
style F fill:#dcfce7,stroke:#16a34a
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["exchangeRate definition\n'Number of sending currency units\nper receiving currency unit'"] --> B{Corridor}
B --> C["USD → INR\nsendingAmount: 10000 ¢\n($100)"]
B --> D["USD → EUR\nsendingAmount: 10000 ¢\n($100)"]
C --> E["exchangeRate = 0.012121\n(1 INR costs 0.012121 USD)\nreceivingAmount = 10000 / 0.012121\n≈ 825,000 paise (₹8,250) ✓"]
D --> F["exchangeRate = 1.081081\n(1 EUR costs 1.081081 USD)\nreceivingAmount = 10000 / 1.081081\n≈ 9,250 cents (€92.50) ✓"]
style A fill:#dbeafe,stroke:#3b82f6
style E fill:#dcfce7,stroke:#16a34a
style F fill:#dcfce7,stroke:#16a34a
Reviews (1): Last reviewed commit: "docs(openapi): correct exchangeRate exam..." | Re-trigger Greptile
Merge activity
|

Summary
The
exchangeRatefield on the/exchange-ratesExchangeRateschema is documented as "Number of sending currency units per receiving currency unit", but the examples were showing the inverse (destination-per-source) direction — contradicting both the field description and the live API:ExchangeRate.yamlschema example: USD→INR82.50allRatesFromUSDresponse example: USD→INR82.50, USD→EUR0.925The live API returns
~0.01for USD→INR, confirming the field is sending-units-per-receiving-unit. This is a docs-only example fix — the API itself is correct (confirmed by the ticket owner on PROD-54).Changes
Corrected the examples to the documented basis, keeping each response example internally consistent with its
sendingAmount/receivingAmount:exchangeRate82.500.0121211/82.50; $100 → ₹8,250 (receivingAmount 825000) ✓exchangeRate0.9251.0810811/0.925; $100 → €92.50receivingAmount185009250Files:
openapi/components/schemas/exchange_rates/ExchangeRate.yamlopenapi/paths/exchange-rates/exchange_rates.yamlopenapi.yaml+mintlify/openapi.yaml(regenerated viamake build)Scope note
PROD-54 was split out of PROD-50 (the broader exchange-rate basis cleanup). The many
exchangeRateexamples in the narrative Mintlify docs (0.92,17.25, etc.) share the same directional inconsistency but are tracked under PROD-50 and intentionally out of scope here. TheQuote.yamlexchangeRatefield shares the same description but has no example, so nothing to fix there.Test plan
make build— rebundles cleanlymake lint-openapi— 0 errors (pre-existing warnings/infos on unrelated schemas only)sendingAmount/receivingAmountFixes PROD-54
Slack thread: https://lightsparkgroup.slack.com/archives/D0AHP8H9E13/p1782750571018079
🤖 volatile-relay(#1) | Feedback
Original PR: #630