Need Help with recursive Union Type #3765
Unanswered
Charismara
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there,
i got the following types:
Click to show
and i would love to create zod schemas for those types.
I'm struggling on the
ArrayTypedFieldExtras
andObjectTypedFieldExtras
Schemas since they require the discriminated union of all schemas to work 😅How would I provide those schemas if they are not defined at that point?
Edit
This is how my current approach looks:
Click to show
The issue with
TypedFieldExtrasSchema
in that case is that somehow thetype
field is typed as optional and unknown which is not accurate.Beta Was this translation helpful? Give feedback.
All reactions