Skip to content

docs: fix CLI docs generator and OpenAPI reference rendering#157

Merged
Leechael merged 3 commits intomainfrom
docs/fix-cli-docs-generator
Apr 18, 2026
Merged

docs: fix CLI docs generator and OpenAPI reference rendering#157
Leechael merged 3 commits intomainfrom
docs/fix-cli-docs-generator

Conversation

@Leechael
Copy link
Copy Markdown
Contributor

@Leechael Leechael commented Apr 18, 2026

Summary

  • Fix CLI docs generator emitting invalid sidebar entries; subcommand pages now carry their sidebar label in the MDX frontmatter.
  • Fix OpenAPI reference placement in docs.json so endpoint pages render correctly.
  • Refresh openapi.json to cover only the public API surface.
  • Add CLI v1.1.18 and JS SDK v0.2.9 changelog entries (picked up via CLI docs regeneration).

Test plan

  • Pre-commit hooks pass (including Mintlify docs.json validation).
  • mintlify broken-links reports no new broken links.
  • Verified in mintlify dev that OpenAPI endpoint pages render with the correct server URL and that CLI subcommand pages show the intended titles.
  • Preview build deploys cleanly.

The CLI docs generator emitted `{"page": "/path", "title": "..."}` entries
inside `pages` arrays, but Mintlify's docs.json schema only accepts strings
or `{"group", "pages"}` nested groups — sidebar labels must come from each
MDX's frontmatter `title`.

- Generate subcommand MDX with `title: "parent sub"` (e.g. `cvms list`).
- Emit plain string paths inside subcommand groups.
- Normalize legacy `{page, title}` objects back to strings on re-run, and
  guard `processPages` against re-nesting a group inside itself.
- Regenerate docs.json and all CLI MDX pages.
Rendering fix:
- Move `openapi` reference from docs.json root into the "Phala Cloud API"
  group. Root-level field is ignored by Mintlify, causing all
  `METHOD /path` entries to 404.

Schema trim (scripts/export_openapi.py in the teehouse repo):
- Add `servers: [{"url": "https://cloud-api.phala.com"}]` so code
  samples no longer show `api.example.com`.
- Exclude Authentication, Billing, Workspace, Profiles, Usage, Tokens,
  and GPUs tags from the public schema.
- Drop operations marked `deprecated: true`.
- Remove `x-mint.href` extension — absolute URLs break local dev links.

Keep: Apps, CVMs, Attestations, KMS, SSH Keys, Instance Types, Webhooks
(102 operations across 88 paths).

docs.json sidebar is synced to match openapi.json exactly (no broken
or hidden entries).
@Leechael Leechael merged commit 2852590 into main Apr 18, 2026
4 checks passed
@Leechael Leechael deleted the docs/fix-cli-docs-generator branch April 18, 2026 06:29
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.

1 participant