ZodResolver is flattening the nested objects in the zod schema. #3294
-
The only thing is that I am not manually defining the zod schema. Instead, I am generating a zod schema from a typescript object. const FormSchema = ZodSchemaGenerator(data, z.object({})) When I am parsing it manually, it's working correctly. console.log(
FormSchema.parse({
title: 'test',
overview: {
metabar: {
metabarTitle: 'met title',
},
description: getEmptyEditorState(),
},
})
) but when inferring the types using The result is as follows: {
description: undefined
metabarTitle: undefined
title: ""
} It is not keeping the nested object fields like |
Beta Was this translation helpful? Give feedback.
Answered by
JacobWeisenburger
Mar 4, 2024
Replies: 1 comment 1 reply
-
Please send a full reproducible code example. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
JacobWeisenburger
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please send a full reproducible code example.