OpenAPI workflow
How API contracts are pinned, published, and consumed by the SDK and docs site.
Where specs live
| Layer | Location |
|---|---|
| Source of truth | NestJS Swagger on backends (packages/backend/bento, packages/backend/tournaments) |
| Pinned snapshots | packages/documentation/contracts/*.json |
| Docs site (this UI) | Markets API · Tournaments API |
| SDK method index | SDK API reference (auto-generated) |
| SDK types | Generated in packages/sdk/src/openapi/ |
Pin contracts
# Markets (live /bento/docs-json)
BENTO_API_URL=https://mainnet-server.bento.fun pnpm docs:pin:markets
# Tournaments (local Nest export — prod disables Swagger)
pnpm docs:pin:tournaments
# Sync snapshots to docs site static assets
pnpm docs:sync-contracts
# Regenerate SDK types
pnpm verify:sdk
# Regenerate SDK API reference page (docs site)
pnpm docs:generate:sdk-referenceLive vs pinned on docs.bento.fun
- Markets API page — tries live
GET /bento/docs-jsonviaNEXT_PUBLIC_MARKETS_OPENAPI_URL, falls back to pinned JSON. - Tournaments API page — uses pinned snapshot by default (Swagger off in production).
Backends are not moved into the documentation package — only exported JSON and the docs UI live there.