DEV Community

Discussion on: Schema Validation with Zod and Express.js

Collapse
 
andresvanegas19 profile image
andresvanegas19 • Edited

Great articule.

For future readers, the nonempty methos is now deprecated.

If you want to implement it, just need to replace like:

z.string({
   required_error: "Name is required",
   invalid_type_error: "Name must be a string",
})
Enter fullscreen mode Exit fullscreen mode

From the documentation: zod.dev/?id=strings