- Downloads
- 850.4K/ mo
- Stars
- 8
- Bundle size
- 554.8 kB
- Updated
- 16h ago
@kubb/plugin-zod generates Zod schemas for runtime validation. Enable inferred to export TypeScript types alongside the schemas.
Installation
bun add -d @kubb/plugin-zod
pnpm add -D @kubb/plugin-zod
npm install --save-dev @kubb/plugin-zod
yarn add -D @kubb/plugin-zod
Dependencies
No plugin dependencies. Install Zod v4 or higher in the consuming app. Enable inferred to use schema-derived types without pluginTs.
Example
kubb.config.ts
import { defineConfig } from 'kubb'
import { pluginZod } from '@kubb/plugin-zod'
export default defineConfig({
input: './petStore.yaml',
output: { path: './src/gen' },
plugins: [
pluginZod({ inferred: true }),
],
})