You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e4b11df
Browse filesBrowse the repository at this point in the historyBrowse files
Add the API reference, and document each error status separately
The reference lives at /reference in a new Astro site. Scalar is bundled rather
than loaded from its CDN: @scalar/astro supports only Astro 4 and 5 while
Starlight needs Astro 7, and a docs page for our own API should not depend on a
third party staying up. createApiReference is imported directly instead, which
costs about 154 KB gzipped from our own origin.
Which API the site talks to comes from PUBLIC_ROLLFUL_API, so the reference can
be pointed at a local Worker. The document itself always names production,
because it is a published artifact; deriving the server from the request does
not work, as wrangler dev reports the configured Custom Domain host over plain
HTTP rather than localhost.
Every error status previously pointed at one shared ErrorResponse schema with no
example, so the reference rendered an identical body for 400, 413, 429 and 500 --
the schema also claimed a 429 could carry invalid_formula, which it cannot. Each
status now has its own schema listing only the codes it can return. Their example
messages are the constants the Worker throws, exported from @rollful/schema for
the same reason the limits are, and a test triggers a real 413 to check the
document against the response.
The document's description now carries a quick start: the npm package for
JavaScript callers, fetch, and a Python example, so the client library panel
reads as a feature rather than filler. It lives in the OpenAPI document, so
anything rendering that document gets it, not only rollful.dev.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments