Closed Thijmen closed 1 week ago
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.
Probably another check will be needed here: https://github.com/kubb-labs/kubb/blob/main/packages/plugin-oas/src/SchemaGenerator.ts#L399 to not add default
to our custom AST.
How it works:
SchemaGenerator
goes over the the openAPI/Swagger file(plugin-oas)creates a custom AST(array of objects with
type` and some extra meta data.@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