-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
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
Zod creates default for nullable property #1409
Comments
I am more than happy to open a PR for this, let me know if this is appreciated. |
@Thijmen Feel free to open a pr, this is more than appreciated. How it works:
|
@stijnvanhulle I'll do my best! How can I run the tests locally at best? |
I've drafted up #1415, with the addition of the "Toy" schema. Hope you like this! 😄 I had fun while making this minor change! 🚀 |
@Thijmen A new version of Kubb has been release with your change: 3.0.9 |
@stijnvanhulle Awesome, thanks for the quick release! |
What version of
kubb
is running?3.0.6
What platform is your computer?
MacOS
What version of external packages are you using(
@tanstack-query
,MSW
,React
,Vue
, ...)No response
What steps can reproduce the bug?
Given following model:
Produces following zod schema:
Name and description now get the
default()
method too. I believe this is not intended, as it's nullable where the default is null;"description": z.string().default().nullable().nullish(),
This leads to the following typescript error:
How often does this bug happen?
Every time
What is the expected behavior?
default()
is not present, because the default is null and the property is nullable.Swagger/OpenAPI file?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: