You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of external packages are you using(@tanstack-query, MSW, React, Vue, ...)
No response
What steps can reproduce the bug?
We have a circular dependency in our schema, like Category can have a children with Category array.
I think, this is a fairly common scenario or at least something that should be handled properly.
The typescript infer fails on this, resulting in a build fail caused by the implicit any.
Here is how it should be handled: https://zod.dev/?id=recursive-types
currently this is the generated code:
import { z } from 'zod'
import type { Tag } from '../ts/Tag'
export const tagSchema = z.object({ id: z.coerce.number().optional(), name: z.coerce.string().optional() }) as z.ZodType<Tag>
What version of
kubb
is running?2.19.5
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?
We have a circular dependency in our schema, like Category can have a children with Category array.
I think, this is a fairly common scenario or at least something that should be handled properly.
The typescript infer fails on this, resulting in a build fail caused by the implicit any.
Here is how it should be handled:
https://zod.dev/?id=recursive-types
currently this is the generated code:
This might have some effect on #1011 as well.
How often does this bug happen?
Every time
What is the expected behavior?
The generated code should be:
Where the type in z.ZodSchema is the one that the ts plugin generates.
Swagger/OpenAPI file?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: