coins: mark decimals optional and document confidence#15
Merged
Conversation
Live responses on api.llama.fi and coins.llama.fi return `confidence` on
price entries today, and coingecko-native assets (e.g. coingecko:ethereum)
legitimately omit `decimals`. The schema did not reflect either, so clients
generating types from the spec were either missing `confidence` or
erroneously treating coingecko coins as malformed.
- `/prices/current/{coins}`, `/prices/historical/{timestamp}/{coins}`,
`/chart/{coins}`: add explicit `required` arrays marking decimals optional
- `/prices/current` and `/prices/historical`: add `confidence` property
- `/chart`: already had `confidence` — add matching description
- Mirror the same three changes in the pro spec under /coins/*
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying api-docs with
|
| Latest commit: |
d29435c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://63be42af.api-docs-59g.pages.dev |
| Branch Preview URL: | https://waynebruce0x-coins-spec-deci.api-docs-59g.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bring the spec in line with what the coins API actually returns today.
decimalsoptional on/prices/current,/prices/historical, and/chartresponses (coingecko-native assets likecoingecko:ethereumlegitimately omit it).confidence(number, 0–1) to/prices/currentand/prices/historicalresponse schemas — prod has returned this for a long time but it wasn't documented./chartalready hadconfidence— added matching description for parity./coins/*.Diff shape
+34 insertions, 0 deletionsacross both files. No reformatting — only the newrequiredarrays, the newconfidenceproperty, and descriptions. JSON validates.Why now
While building a live spec-compliance test suite against
coins.llama.fiI found two systematic mismatches that caused test failures:typeof decimals === "number"failed on coingecko-native batchesconfidencehad no schema to compare againstBoth are code-behaves-correctly-but-spec-is-wrong cases. This PR fixes the spec side only. Undocumented endpoints in
coins/serverless.yml(/mcaps,/chains,POST /prices, etc.) are intentionally not covered here.Test plan
confidenceshows up on the right shapes🤖 Generated with Claude Code