You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building an API using ZSA. The problem is, any input I'm getting are getting converted to an object before getting validated. In my case, the input should be an array of objects, but having z.array(z.object({}).passthrough()) as an input type throws a validation error because the array was transformed into an object with the structure {'0': {...}, '1':{...},...}.
I have a workaround using preprocess with v=>Object.values(v) but this still seems to be undesired behaviour/a bug
Thanks and best regards,
Milan
The text was updated successfully, but these errors were encountered:
Hello everyone,
I'm building an API using ZSA. The problem is, any input I'm getting are getting converted to an object before getting validated. In my case, the input should be an array of objects, but having z.array(z.object({}).passthrough()) as an input type throws a validation error because the array was transformed into an object with the structure {'0': {...}, '1':{...},...}.
I have a workaround using preprocess with v=>Object.values(v) but this still seems to be undesired behaviour/a bug
Thanks and best regards,
Milan
The text was updated successfully, but these errors were encountered: