How can I write this type with Zod?
Can someone pls help me to write this type with Zod?
TLDR: the object and all nested objects need to have the listed attributes but they cann all be extended.
I tried something like this but when I try to safe parse it, it says that the data is unknown.
2 Replies
You have an extra level of nesting of a text property with an array + object inside, try removing one of the
{ text: z.array(z.object(...)) }
levelstyty ❤️