Skip to content

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)#631

Merged
AaryamanBhute merged 1 commit into
mainfrom
06-29-PROD-54-fix-exchange-rate-example-basis
Jun 29, 2026
Merged

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)#631
AaryamanBhute merged 1 commit into
mainfrom
06-29-PROD-54-fix-exchange-rate-example-basis

Conversation

@AaryamanBhute

Copy link
Copy Markdown
Contributor

Summary

The exchangeRate field on the /exchange-rates ExchangeRate schema 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.yaml schema example: USD→INR 82.50
  • allRatesFromUSD response example: USD→INR 82.50, USD→EUR 0.925

The live API returns ~0.01 for 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:

Corridor Before After Basis check
USD→INR exchangeRate 82.50 0.012121 1/82.50; $100 → ₹8,250 (receivingAmount 825000) ✓
USD→EUR exchangeRate 0.925 1.081081 1/0.925; $100 → €92.50
USD→EUR receivingAmount 18500 9250 €92.50 at the corrected rate ✓

Files:

  • openapi/components/schemas/exchange_rates/ExchangeRate.yaml
  • openapi/paths/exchange-rates/exchange_rates.yaml
  • openapi.yaml + mintlify/openapi.yaml (regenerated via make build)

Scope note

PROD-54 was split out of PROD-50 (the broader exchange-rate basis cleanup). The many exchangeRate examples 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. The Quote.yaml exchangeRate field shares the same description but has no example, so nothing to fix there.

Test plan

  • make build — rebundles cleanly
  • make lint-openapi — 0 errors (pre-existing warnings/infos on unrelated schemas only)
  • Verified each corrected example is internally consistent with its sendingAmount/receivingAmount

Fixes PROD-54

Slack thread: https://lightsparkgroup.slack.com/archives/D0AHP8H9E13/p1782750571018079


🤖 volatile-relay(#1) | Feedback

Original PR: #630

… (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).

akanter commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This stack of pull requests is managed by Graphite. Learn more about stacking.

@AaryamanBhute AaryamanBhute requested a review from pengying June 29, 2026 16:38
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

This PR will update the grid SDKs with the following commit messages.

cli

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)

csharp

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)

go

chore(internal): regenerate SDK with no functional changes

kotlin

chore(tests): update exchange rate test fixture values

openapi

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)

php

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)

python

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)

ruby

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)

typescript

docs(openapi): correct exchangeRate example to match documented basis (PROD-54)
⚠️ grid-openapi studio · code

Your SDK build had at least one "warning" diagnostic.
generate ⚠️

grid-ruby studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ⏭️lint ✅test ✅

⚠️ grid-go studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ⏭️lint ❗test ❗

go get github.com/stainless-sdks/grid-go@aeb1e112a215cd75900a3ab22426bec7e7ec5761
grid-typescript studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ⏭️lint ⏭️test ✅

⚠️ grid-kotlin studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
generate ⚠️build ✅lint ✅test ❗

⚠️ grid-python studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
generate ✅build ⏭️lint ⏭️test ❗

⚠️ grid-csharp studio · code

Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ⚠️build ❗lint ✅test ❗

grid-php studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅lint ✅test ✅

⚠️ grid-cli studio · code

Your SDK build had a failure in the test CI job, which is a regression from the base state.
generate ⚠️build ⏭️lint ⏭️test ❗


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-06-29 16:46:05 UTC

@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR corrects the exchangeRate example values in the OpenAPI schema and response examples to match the documented field definition: "Number of sending currency units per receiving currency unit." The previous examples showed the inverse (destination-per-source) direction, contradicting both the description and the live API.

  • ExchangeRate.yaml: Schema-level exchangeRate example updated from 82.50 to 0.012121 (USD→INR basis).
  • exchange_rates.yaml: Both USD→INR and USD→EUR response examples corrected; the EUR receivingAmount is also updated from 18500 to 9250 for internal consistency with sendingAmount: 10000 at the corrected rate.
  • openapi.yaml / mintlify/openapi.yaml: Regenerated bundles that mechanically reflect the above source changes.

Confidence Score: 5/5

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

Important Files Changed

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
Loading
%%{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
Loading

Reviews (1): Last reviewed commit: "docs(openapi): correct exchangeRate exam..." | Re-trigger Greptile

@AaryamanBhute AaryamanBhute merged commit 8aa0022 into main Jun 29, 2026
15 of 17 checks passed

Copy link
Copy Markdown
Contributor Author

Merge activity

@AaryamanBhute AaryamanBhute deleted the 06-29-PROD-54-fix-exchange-rate-example-basis branch June 29, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants