OpenAPI

Drop an OpenAPI spec into your config and ciderpress generates a full API reference — overview page, per-operation pages, and sidebar entries.

See the Petstore API Reference for a live example.

Configuration

Add openapi to your root config or to any workspace item:

export default defineConfig({
  openapi: {
    spec: 'openapi.json',
    path: '/api',
  },
})
OptionTypeRequiredDefaultDescription
specstringyesPath to the OpenAPI JSON or YAML file, relative to repo root
pathstringyesURL path for generated pages (e.g. '/api')
titlestringno'API Reference'Sidebar group title and overview page heading
sidebarLayout'method-path' | 'title'no'method-path'How operations appear in the sidebar

What gets generated

During ciderpress sync, the spec is fully dereferenced (all $refs resolved) and three types of files are written:

FileDescription
{path}/openapi.jsonThe dereferenced spec as JSON
{path}/index.mdxOverview page with API info, servers, auth schemes, and operation summary
{path}/{operation}.mdxOne page per operation with full spec details and code examples

Operations are extracted from paths, grouped by their first tag, and slugified from operationId. If no operationId exists, the slug is derived from the method and path.

Overview page

The overview page renders API title, version, description, server URLs, authentication schemes, and a summary of operations grouped by tag.

https://docs.example.com/petstore

OpenAPI overview page

Operation page

Each operation gets a two-column layout with spec details on the left (parameters, request body, responses, security) and auto-generated code examples on the right (cURL, JavaScript, Python, Go, Ruby, Java).

https://docs.example.com/petstore/getpetbyid

OpenAPI operation page

method-path (default)

Each sidebar entry shows a colored method badge and the path in monospace. Both screenshots above show this layout in the sidebar.

title

Each sidebar entry shows the operation's summary as plain text instead of the method and path.

Per-workspace OpenAPI

Attach an OpenAPI spec to any workspace item for per-package API docs:

ciderpress.config.ts
export default defineConfig({
  workspaces: [
    {
      title: 'Services',
      icon: 'pixelarticons:server',
      items: [
        {
          title: '@acme/api',
          description: 'REST API service',
          path: '/packages/api',
          openapi: {
            spec: 'packages/api/openapi.yaml',
            path: '/packages/api/reference',
            title: 'API Reference',
            sidebarLayout: 'title',
          },
          items: [{ title: 'Overview', path: '/packages/api', include: 'packages/api/README.md' }],
        },
      ],
    },
  ],
})

References