@kubb/plugin-redoc
@kubb/plugin-redoc turns your OpenAPI spec into a static HTML documentation page with Redoc. The output is a single file with the spec embedded inline, so you can drop it on any static host without a build step. The page loads the Redoc bundle and fonts from a CDN when viewed, so rendering needs network access.
Kubb rebuilds the file on every run. Your docs stay in step with the spec your code was generated from.
This plugin reads the OpenAPI adapter. Kubb uses adapterOas() by default, so it works out of the box. You set adapter yourself only if you replaced that default with another adapter.
Installation
shell
bun add -d @kubb/plugin-redoc@betashell
pnpm add -D @kubb/plugin-redoc@betashell
npm install --save-dev @kubb/plugin-redoc@betashell
yarn add -D @kubb/plugin-redoc@betaExample
typescript
import { } from 'kubb'
import { } from '@kubb/adapter-oas'
import { } from '@kubb/plugin-redoc'
export default ({
: { : './petStore.yaml' },
: { : './src/gen' },
: (),
: [
({
: { : 'docs.html' },
}),
],
})