-
Hi, I'm facing an issue that I can't initialize zodios endpoint if I use zod validation for If anyone know how to overcome this? (with following constraint)
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I don't think this will work. So maybe use FormData directly like in the example here : |
Beta Was this translation helpful? Give feedback.
-
I've found my problem also asked on a zod issue. Instead of I'm making it more type safe with z.any() as ZodType<File> And I'm satisfied with it. UPDATE!! z.custom<File>() |
Beta Was this translation helpful? Give feedback.
I've found my problem also asked on a zod issue. Instead of
z.instanceof(File)
which would not be valid on server side, @zanzlender has a great way to validate the input (the check might only be valid on client side).I'm making it more type safe with
And I'm satisfied with it.
UPDATE!!
zod recently document the feature for custom schema. (seem like this method already being there for a while)