I am currently working on creating a form using React-hook-form and zod resolver. My goal is to have all fields be optional, yet still required despite being marked as optional in the zod schema:
const schema = z.object({
name: z.string().min(3).max(50).optional(),
description: z.string().min(3).max(255).optional(),
image: clientImageSchema.optional(),
})
const {...} = useForm({ resolver: zodResolver(schema) })
Upon submitting the form with blank inputs, it is validating the fields as required. I am trying to identify where the error or mistake may lie. Can you help me troubleshoot this issue?