zod
zod copied to clipboard
`CreateParams` get lost when calling any of the root-level methods
const MySchema = z.string({ description: 'this is a string schema' }).optional()
// => No longer has the description associated with it
This is because we are not passing the CreateParams
to these methods on the root-level ZodType
class.
Instead of:
nullable() {
ZodNullable.create(this);
}
We should find a way to pass the CreateParams
as well.
nullable() {
ZodNullable.create(this, /* => */ params);
}