#Zod Validate
1 messages · Page 1 of 1 (latest)
Based on the information provided in the extracts, it seems you are trying to use the Zod library for schema validation in your Next.js application. Zod is indeed recommended for advanced server-side validation in Next.js as per the Next.js documentation (https://nextjs.org/docs/pages/building-your-application/data-fetching/forms-and-mutations#form-validation).
However, the specific code you provided is not present in the extracts, so I can't provide a direct answer or validation for it.
In general, to validate an array of objects with Zod, you would use z.array(z.object({...})) as you have done in your code. This should validate each object in the galleryTour array according to the schema you've defined inside z.object({...}).