-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Thanks for the library! Is there a reason Zodix modifies incoming FormData objects (https://github.com/rileytomasek/zodix/blob/master/src/parsers.ts#L189)? We just found a regression in our app related to this behavior as it pertains to FormData with file uploads.
We have a Remix action function that handles incoming FormData differently depending on the FormData's subaction, and one of these handlers expects a File to be present in FormData. We initially use Zodix to parse the subaction via a call to parseFormSafe. Once we know the subaction we pass the FormData towards further Zod validation (variable schema depending on the subaction). Before parsing through Zodix formData.get('file') yields a File object (expected by our downstream validation schema), and then after it yields a string (ex. '{"_name":"file.json","_lastModified":1674149960469}') which causes the downstream schema to fail.
We're giving Zodix a request clone as a workaround, but wanted to toss this behavior on the radar as we would like to unwind it eventually if possible.