Colin McDonnell
Colin McDonnell
I do see your use case here and think it's valid/interesting. But I don't like this ``` const MyEnum = z.enum({ A: z.literal(1).describe("Label A"), B: z.literal(2).describe("Label B"), }); ``` And...
Are you sure you're able to override `type` declarations in this way? In my experiments I get a "Duplicate identifier" error.
Why do you want the discriminator to be statically knowable?
Thanks, agreed this can be improved. This is coming from a vendor I work with, but I've put in a request.
Inkeep has landed improvements! It's far better. Good call @0xA-10 
I'd recommend filing a bug in module federation, as this `package.json` approach is used by all projects using tshy: https://github.com/isaacs/tshy This particular approach is used to guarantee proper ESM/CJS detection...
cc @brentswisher @gkamperis This is fixed in recent versions of Zod.
This is very hard to fix in Zod 4 for complicated reasons. I seem to be up against some TypeScript limitations: https://github.com/colinhacks/zod/issues/4905#issuecomment-3105480033
Thanks, fixed in latest.
It's very unlikely any context mechanism gets added, as it's a big footgun. Dynamic schemas require dynamic scoping, which is why the recommended approach here is your first suggestion: >...