feat: add interactive API reference with per-operation pages#4953
Open
philip wants to merge 6 commits into
Open
feat: add interactive API reference with per-operation pages#4953philip wants to merge 6 commits into
philip wants to merge 6 commits into
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
New tags in the upstream spec no longer break the build.
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
What changed
Generator (
scripts/generate-api-ref.mjs): fetches OpenAPI spec at build time, emits per-operation JSON undersrc/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.jsrace-condition fix,src/hooks/use-local-storage.jsstable-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