Skip to content

feat: add interactive API reference with per-operation pages#4953

Open
philip wants to merge 6 commits into
mainfrom
api-ref-restructure
Open

feat: add interactive API reference with per-operation pages#4953
philip wants to merge 6 commits into
mainfrom
api-ref-restructure

Conversation

@philip
Copy link
Copy Markdown
Collaborator

@philip philip commented May 22, 2026

Summary

  • Adds /docs/reference/api/ as a fully interactive API reference built from the live Neon OpenAPI spec at build time
  • Each operation gets its own page with editable path params, request body, and copy-ready curl / TypeScript SDK / CLI / MCP code examples
  • Cross-page session globals (org_id, project_id, branch_id, etc.) persist in sessionStorage via Zustand
  • Fuse.js endpoint search, tag overview pages, and llms.txt/markdown output for agent consumption

What changed

Generator (scripts/generate-api-ref.mjs): fetches OpenAPI spec at build time, emits per-operation JSON under src/data/api-ref/, navigation YAML, and Markdown stubs for agents/LLMs.

Interactive editor (src/components/pages/doc/api-operation/): tabbed API / CLI / SDK / MCP editor backed by a Zustand store with sessionStorage persistence. Annotated schema tree with inline editable fields.

Routes (src/app/(docs)/docs/reference/api/): single Next.js catch-all serves tag pages, operation pages, and static Markdown pages.

Supporting utilities: src/utils/api-ref.mjs (curl/TS/CLI builders), src/lib/shiki.js race-condition fix, src/hooks/use-local-storage.js stable-reference fix, src/components/pages/doc/menu/ recursive active detection and split header for nav nodes with both a slug and children.

Co-authored-by: Isaac

Per-operation pages with editable params, curl/TS/CLI/MCP tabs, and
cross-page session globals built from the live OpenAPI spec at build time.

Co-authored-by: Isaac
@philip philip requested a review from danieltprice as a code owner May 22, 2026 19:04
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
neon-next Ready Ready Preview, Comment May 29, 2026 6:55pm

Request Review

New tags in the upstream spec no longer break the build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants