validating schema has one of several props in the object
I am using Zod to validate my schema, but one particular part of the object I am expecting can have one of three different key/values.
Using Zod to validate only part of my object
I am wanting to validate an object with Zod that I am receiving that I know will grow and change in the future. It will grow/change in areas I am not concerned with.
Using Zod to validate only part of my object
I am wanting to validate an object with Zod that I am receiving that I know will grow and change in the future. It will grow/change in areas I am not concerned with.
zod – check if any of object properties pass validation
I have a schema like this:
Custom Zod Validator
I want to build a custom Zod validator as follows: