Add OpenAPI spec and integrate vitepress-openapi for API docs#16
Merged
Add OpenAPI spec and integrate vitepress-openapi for API docs#16
Conversation
Integrates the Cycles Protocol OpenAPI spec as an interactive, Redocly-style API reference rendered natively in VitePress via the vitepress-openapi plugin. The new page lives alongside the existing manual API reference in the Protocol Reference sidebar. https://claude.ai/code/session_01FL2ggKU9YaFR1uUK53nTMY
Enhances the OpenAPI reference to generate individual pages per endpoint (9 operations) with an auto-generated sidebar grouped by API tags (Decisions, Reservations, Balances, Events), plus a full-spec overview page. - Add YAML-to-JSON spec conversion script (scripts/convert-spec.js) - Create dynamic route files for per-operation pages (api/operations/) - Add full-spec overview page at /api/ - Convert sidebar config to path-based (separate sidebar for /api/ pages) - Add "API Reference" to top nav - Add yaml dependency for spec conversion https://claude.ai/code/session_01FL2ggKU9YaFR1uUK53nTMY
This was referenced Apr 19, 2026
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
This PR adds the Cycles Budget Authority API OpenAPI specification (v0.1.23) and integrates it with the documentation site using vitepress-openapi for interactive API reference generation.
Key Changes
Added OpenAPI specification (
public/cycles-protocol-v0.yaml): Complete v0.1.23 protocol definition including:Integrated vitepress-openapi:
vitepress-openapidependency for rendering interactive API documentationscripts/convert-spec.js) to transform YAML spec to JSONapi/operations/[operationId].md) with dynamic path generation/.vitepress/theme/index.ts) to enable OpenAPI componentsUpdated documentation configuration:
.vitepress/config.tsto include OpenAPI sidebar generation and API Reference nav link.gitignoreentry for generatedpublic/openapi.jsonUpdated build scripts (
package.json):convert-specscript to generate JSON from YAMLbuildanddevscripts to run spec conversionImplementation Details
The OpenAPI spec defines a minimal, language-agnostic protocol for deterministic budget governance with:
The integration enables developers to browse and interact with the API specification directly in the documentation site.
https://claude.ai/code/session_01FL2ggKU9YaFR1uUK53nTMY