Open sschneider-ihre-pvs opened 6 months ago
@sschneider-ihre-pvs Thanks! Yeah, I agree fix this if possible to keep returning type the same as current.
Could you send me PR for this?
I am interested in providing a fix for this. I think we must do 2 things:
z.lazy
. We can try and detect recursive references (by implementing a DFS), or simply use z.lazy
everywhere. There isn't really a downside to the latter.let xxxSchema: null | ZodType<xxxx>
for each function should be enough) so that multiple calls returns the same reference.I can get started by hacking my way through the generator but any help/advice would be appreciated!
There is a chance that there will be some self referencing group going on which is currently not supported but is possible in Zod for example
This leads to callstack size exceeded
This does not