-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
I want to globally modify an error message via z.config for z.file().mime("text/plain").
But the issue provided at customError only provides this information:
I see no way to narrow down to any of the internals like $ZodCheckMimeType and I don't think it would be a good idea either.
Neither is checking against the input string with the "actual" mime-types viable approach.
I'm a bit surprised, that input is not just File in that case.
Other codes can be easily narrowed: invalid_type via expected and when the type is valid, then input is typically the value provided. Not sure, why here it is suddenly converted to the mime-types that are expected, instead of leaving input the (at this point) valid_type - File - and provide information like expected and actual separately.