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

Support for conditional validation with class-validator #36

Merged
merged 2 commits into from
Jan 20, 2024

Conversation

iamciroja
Copy link

No description provided.

@Brakebein
Copy link
Owner

Looks solid to me. It also adds @ValidateIf in general, which is nice.

It works for simple expressions. Other use cases may include calling a special function inside, e.g. @ValidateIf(o => runCustomTest(o)). However, this needs more complex parsing and collecting imports similar to the @DtoCastType decorator. I think we can keep it simple for now and may extend it when someone requests it.

@Brakebein Brakebein merged commit cce9517 into Brakebein:main Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants