Closed FaresKi closed 11 months ago
you can use
UsersSchema.omit({ id:true })
or
UsersSchema.extend({
id: z.number().nullish()
})
I ran into the same issue and used the omit annotation which removed it from the schema entirely. Alternatively, you can have fields with default values marked as optional by enabling this feature.
Hi! Great plugin, super handful. I just got a quick question. I got a schema model similar to the following:
The plugin generates the zod schema, which is helpful:
But I want
id
to be considered optional, so when it comes to creating users, i don't need it to be there. How can I do so?Thanks!