Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have zod respect Rule.valueOfField(siblingField) #516

Open
saiichihashimoto opened this issue Nov 30, 2023 · 0 comments
Open

Have zod respect Rule.valueOfField(siblingField) #516

saiichihashimoto opened this issue Nov 30, 2023 · 0 comments
Labels
help wanted Please help me! I'm lonely.

Comments

@saiichihashimoto
Copy link
Owner

saiichihashimoto commented Nov 30, 2023

After #336, valueOfField no longer breaks, but zod doesn't validate with them. Ideally, zod would include all validations (except for custom, read this). It's difficult to layer in the validations at the field level, because the containing object isn't included (and doesn't exist yet, considering the field is part of the definition). We'd have to generate the object schema, then go back through each field and find the validations that used valueOfField() to go and do those, which is somewhat of a back and forth. Might be worth it to ignore validations all together initially, generate the whole object schema, then layer the validations for each field on top of it. Would have to double check this works fine for objects of objects.

@saiichihashimoto saiichihashimoto added the help wanted Please help me! I'm lonely. label Nov 30, 2023
@saiichihashimoto saiichihashimoto added help wanted Please help me! I'm lonely. and removed help wanted Please help me! I'm lonely. labels Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Please help me! I'm lonely.
Projects
None yet
Development

No branches or pull requests

1 participant