Closed
Description
What version of kubb
is running?
3.12.0
What kind of platform do you use?
MacOS
Your kubb.config.ts
config file?
import { defineConfig } from '@kubb/core';
import { pluginOas } from '@kubb/plugin-oas';
import { pluginZod } from '@kubb/plugin-zod';
export default defineConfig(() => {
return {
input: {
path: './api/swagger.yaml',
},
output: {
clean: true,
extension: { '.ts': '' },
path: './src/DataSources/Trainings/__generated__',
},
plugins: [
pluginOas(),
pluginZod({
dateType: 'stringOffset',
group: { type: 'tag' },
inferred: true,
output: { barrelType: 'propagate', path: './zod' },
unknownType: 'unknown',
version: '4',
}),
],
};
});
Swagger/OpenAPI file?
not needed here
What version of external packages are you using(@tanstack-query
, MSW
, React
, Vue
, ...)
not needed here
What steps can reproduce the bug?
Set up the Zod plugin with using version 4 and run the generation by pnpm dlx kubb@latest generate --config kubb.config.ts
.
How often does this bug happen?
Every time
What is the expected behaviour?
Current behavior:
Expected behavior:
Additional information
Thanks for implementing Zod v4.
Currently, incorrect imports are being used when generating with Zod v4. Instead of
import { z } from 'zod';
it should be
import { z } from 'zod/v4';
This issues have caused errors in the created schemas.