Replies: 1 comment
-
One workaround I've found seems to be viable, but I don't know if this would be a recommended approach, tampering with an internal function: var lazy = z.lazy(() => z.null()); // Placeholder
var x = z.object({prop1: 'string', prop2: lazy});
// Use the object within another
var y = z.array(x);
// Modify the placeholder after the fact
lazy._def.getter = () => x; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like the ability to store schema references and later replace them with a modified schema (e.g., with recursive properties added).
Something like:
Is this conceivable?
Beta Was this translation helpful? Give feedback.
All reactions