Set empty object when zodDiscriminatedUnion is specified. #892
Replies: 2 comments 12 replies
-
|
Thank you for your suggestion. I don't understand everything, so can you tell us why I used Zod's playground to define a nested schema using Please explain in more detail if I don't understand your problem well. |
Beta Was this translation helpful? Give feedback.
-
|
I found something very interesting. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello team,
In
parseWithZod, value coerce to empty object, if schema is ZodObject.ref. https://github.com/edmundhung/conform/blob/v1.3.0/packages/conform-zod/coercion.ts#L240-L243
I think value should also coerce to empty object, if schema is ZodDiscriminatedUnion.
because ZodDiscriminatedUnionOption is extended type of ZodObject.
like this taku-hatano@c8514a4
What do you think about it?
Beta Was this translation helpful? Give feedback.
All reactions