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.
Thanks for the library! Is there a reason Zodix modifies incoming
FormDataobjects (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 toFormDatawith file uploads.We have a Remix action function that handles incoming
FormDatadifferently depending on theFormData's subaction, and one of these handlers expects aFileto be present inFormData. We initially use Zodix to parse the subaction via a call toparseFormSafe. Once we know the subaction we pass theFormDatatowards further Zod validation (variable schema depending on the subaction). Before parsing through ZodixformData.get('file')yields aFileobject (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.