OpenAPI Sync

Transforms OpenAPI specs into browsable MDX pages with interactive components.

Overview

The OpenAPI sync (sync/openapi.ts) is a sub-pipeline bolted onto the main sync engine. It collects specs from the config, dereferences $refs, generates one MDX page per operation, and builds sidebar items grouped by tag.

Steps

#StepWhat it does
1Collect configsGather OpenAPI configs from root config.openapi and entry-level openapi fields (apps, packages, and workspace items)
2Check mtimeStat the spec file and compare its mtime to the previous manifest to decide whether a shared cached dereference can be reused
3DereferenceResolve all $refs via @apidevtools/swagger-parser (or use cached result)
4Extract operationsPull operations from paths, group by tag
5Generate MDXOne .mdx per operation (renders <OpenAPIOperation>) + overview page (<OpenAPIOverview>)
6Build sidebarSidebar items grouped by tag with configurable layout (method-path or title)
7Emit specEmit dereferenced spec as a virtual openapi.json page (written by the sync engine's copy step)

Caching

In dev mode, a shared Map<string, unknown> is created once and threaded through all sync passes. See Dev Mode — OpenAPI Cache for lifecycle details.

References