The OpenAPI adapter sits between your spec and every Kubb plugin. It reads the file at input.path, validates it, and converts each schema and operation into Kubb's universal AST that downstream plugins consume.
Configure it once on defineConfig. Its choices for date representation, integer width, and server URL apply to every plugin in the build.
See Options for the full configuration reference.
Installation
shell
bun add -d @kubb/adapter-oas@betashell
pnpm add -D @kubb/adapter-oas@betashell
npm install --save-dev @kubb/adapter-oas@betashell
yarn add -D @kubb/adapter-oas@betaExample
typescript
import { } from 'kubb'
import { } from '@kubb/adapter-oas'
import { } from '@kubb/plugin-ts'
export default ({
: { : './petStore.yaml' },
: { : './src/gen' },
: ({
: true,
: { : 0, : { : 'prod' } },
: 'propagate',
: 'root',
: 'date',
: 'number',
: 'unknown',
: 'unknown',
: 'enum',
}),
: [()],
})