Skip to content

Add Admin API documentation alongside Cycles Protocol API#26

Merged
amavashev merged 1 commit intomainfrom
claude/add-admin-api-docs-Owqqg
Mar 15, 2026
Merged

Add Admin API documentation alongside Cycles Protocol API#26
amavashev merged 1 commit intomainfrom
claude/add-admin-api-docs-Owqqg

Conversation

@amavashev
Copy link
Contributor

Summary

This PR adds support for documenting the Admin API alongside the existing Cycles Protocol API. The changes refactor the spec conversion script to be reusable, add Admin API documentation pages, and update the navigation to support multiple API references.

Key Changes

  • Refactored spec conversion script (scripts/convert-spec.js): Extracted the hardcoded spec conversion logic into a reusable convertSpec() function that accepts a spec name, candidate paths, and output filename. Now converts both the Cycles Protocol spec and the Admin API spec.
  • Added Admin API documentation pages:
    • admin-api/index.md: Overview page for the Admin API reference
    • admin-api/operations/[operationId].md: Dynamic operation detail pages
    • admin-api/operations/[operationId].paths.js: Path generation for Admin API operations
  • Updated VitePress configuration (.vitepress/config.ts):
    • Imported the new admin-openapi.json spec
    • Created adminApiSidebar using the Admin API spec
    • Updated navigation to show API Reference as a dropdown with both "Cycles Protocol API" and "Admin API" options
    • Added /admin-api/ sidebar configuration with generated operation groups
  • Updated CI/CD (.github/workflows/deploy.yml): Added checkout step for the cycles-server-admin repository to make the Admin API spec available during deployment

Implementation Details

  • The convertSpec() function handles spec discovery across multiple candidate paths (environment variable, local dev sibling repo, CI workspace), with improved error messaging that shows all searched locations
  • Admin API spec is sourced from cycles-server-admin/complete-budget-governance-v0.1.23.yaml and converted to public/admin-openapi.json
  • Both API references use the same vitepress-openapi integration pattern for consistent documentation generation

https://claude.ai/code/session_01WovqCqTJJdoDwpdDym4UM4

Expose the cycles-server-admin OpenAPI spec as a second interactive API
reference section at /admin-api/. The existing Cycles Protocol API remains
at /api/. Navigation now uses a dropdown to link both specs.

- Refactor convert-spec.js to handle both YAML specs
- Add admin sidebar and dropdown nav in VitePress config
- Create admin-api/ pages with OASpec/OAOperation using :spec prop
- Update CI workflow to checkout cycles-server-admin repo

https://claude.ai/code/session_01WovqCqTJJdoDwpdDym4UM4
@amavashev amavashev merged commit a34af92 into main Mar 15, 2026
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