We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubb
3.6.1
Linux
kubb.config.ts
import { defineConfig } from '@kubb/core' import { pluginOas } from '@kubb/plugin-oas' import { pluginZod } from '@kubb/plugin-zod' export default defineConfig({ name: 'Test', root: './src', input: { data: JSON.stringify({ openapi: '3.1.0', components: { schemas: { TestSchema: { properties: { stringField: { type: 'string', }, nullField: { type: 'null', }, }, type: 'object', required: [], }, }, }, }), }, output: { path: './__generated__', clean: true, }, plugins: [pluginOas(), pluginZod()], })
@tanstack-query
MSW
React
Vue
{ "zod": "3.24.2", "react": "19.0.0", "typescript": "5.7.3" }
Given the example kubb.config.ts file, run the generator and observe the syntax error in the generated zod schema:
import { z } from "zod"; export const testSchemaSchema = z.object({ "stringField": z.string().optional(), "nullField": .optional()z.null() })
Every time
The null field should match the behaviour of the string field
import { z } from "zod"; export const testSchemaSchema = z.object({ "stringField": z.string().optional(), "nullField": z.null().optional() })
No response
The text was updated successfully, but these errors were encountered:
Correct order for null field - Fixes kubb-labs#1584
e69801a
Merge pull request #1610 from lambdank/patch-1
c0687d3
Correct order for null field - Fixes #1584
Successfully merging a pull request may close this issue.
What version of
kubb
is running?3.6.1
What kind of platform do you use?
Linux
How does your
kubb.config.ts
config look likeWhat version of external packages are you using(
@tanstack-query
,MSW
,React
,Vue
, ...)What steps can reproduce the bug?
Given the example kubb.config.ts file, run the generator and observe the syntax error in the generated zod schema:
How often does this bug happen?
Every time
What is the expected behavior?
The null field should match the behaviour of the string field
Additional information
No response
The text was updated successfully, but these errors were encountered: