tristinDLC
ZZod
•Created by Haddok on 11/10/2024 in #questions
Haddok - hi , i have defined a schema where i a...
Are you trying to do something like:
4 replies
ZZod
•Created by unnreaal on 8/27/2024 in #questions
unreal - Hello, i have this schema tsconst som...
@Scott Trinh Wow, I misread OP. I missed the curly braces originally and understood the problem to be that only
null
was being sent. That's my mistake. Looks like I need a nap haha9 replies
ZZod
•Created by unnreaal on 8/27/2024 in #questions
unreal - Hello, i have this schema tsconst som...
The issue is that the
.nullable()
and .optional()
methods are being applied to the value associated with the "description" key only. The original z.object()
that's wrapping your keys is still required to be provided to properly validate.
Here is the code that works based on your schema above:
9 replies