-
Notifications
You must be signed in to change notification settings - Fork 69
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
Drizzle Zod + lazy #255
Comments
@samducker sadly we do not support z.lazy as of right now and this has been the case for a while. #191. The main workaround would be to use the For example: type Category = {
name: string;
subcategories: Category[];
};
const categorySchema: z.ZodType<Category> = z
.object({
name: z.string(),
subcategories: z
.lazy(() => categorySchema.array())
.openapi({
type: 'array',
items: {
$ref: '#/components/Category',
},
}),
})
.openapi('Category'); We are open to the idea of making it work. However time is scarce and I cannot give an estimate as to when we would be able to include such feature considering it would take some overhaul of our codebase |
@samducker I will close this task since it is a duplicate with #247 and has more tracking |
Hi in all of my schemas created with 'drizzle-zod'
They cause this library to throw this error
I have searched the issues here and not found a workaround for this apart from not using drizzle zod, which is not ideal
as the benefit of using it is that my database schema stays as the source of truth for my route definition schemas.
Do you have any workarounds or advice to overcome this issue?
The text was updated successfully, but these errors were encountered: