Closed OrKoN closed 6 months ago
cc @jrandolf
Alternatively, we should use passthrough on all objects to closer match cddl.
Using passthrough would be an implementation detail. CDDL doesn't specify anything regarding extra attributes. In particular, users' should rely strictly on what the CDDL specifies.
From looking at the issue, making sure the order of productions is correct should fix the problem. See https://github.com/colinhacks/zod?tab=readme-ov-file#unions
Sometimes there is an need for some objects to allow extra attributes via .passthrough(). There should be an option to specify which types need to call passthrough for zod.