Colin McDonnell

Results 258 comments of Colin McDonnell

I dig it! Sorry I couldn't fit this into 3.20 - had to stop tinkering and just cut a release. The naming is of course perfect. This'll get merged soon.

This sort of exists but is undocumented...whoops. ```ts const schema = z.custom(); ``` This runs no validation checks on the input, but the inferred type is whatever you've passed as...

Hm :( This is definitely an important use case but I think the proposed behavior is pretty weird. It's inconsistent with how coercion is handled with other data types. I...

Perhaps a `zod-formdata` lib is called for ```ts import * as zfd from "zod-formdata"; zfd.formdata({ checkbox: zfd.boolean(), field: zfd.string(), array: zfd.all(z.string()) // uses `FormData.getAll()`, jsonified: zfd.json() // input must be...

Handling form submissions server-side using `FormData` is egregious and I hope Remix moves away from it. `FormData` isn't actually supported by Node or Bun. I don't understand how people handle...

Ah good catch. @pheuter want to try to propose an API/behavior that would work for you? I've never gotten very far here. Some open questions: - The set of input...

I'd say this is intentional for the moment. Currently Zod can't really differentiate between `{arg: string | undefined}` and `{arg?: string | undefined}`. When you pass a key schema `S`...

> How does one write `anything but something must be passed in and it cannot be undefined`? This is the best I've got: ```ts const schema = z.object({ field: z.custom((x)...

> It would be really nice if we could define "any object" as a property (and it is a required property when it does schema validation). Cool idea! Open to...

@carlgieringer Unfortunately this has been reverted in 3.21 for causing infinite recursion & compiler slowdowns. It's possible this can be re-implemented in a way that avoids these issues (*maybe*) but...