class-validator
class-validator copied to clipboard
feat: `validateIf` for validation options
Description
Add validateIf
for validation options.
If you want to validate that condition by object, you can use validation validateIf
.
ValidateIf
will skip all other decorators, validation validateIf
only effect the decorator that use this option
Checklist
- [x] the pull request title describes what this PR does (not a vague title like
Update index.md
) - [x] the pull request targets the default branch of the repository (
develop
) - [x] the code follows the established code style of the repository
-
npm run prettier:check
passes -
npm run lint:check
passes
-
- [x] tests are added for the changes I made (if any source code was modified)
- [x] documentation added or updated
- [x] I have run the project locally and verified that there are no errors
Fixes
references https://github.com/typestack/class-validator/issues/1455
I think I prefer the skip
or skipIf
name for this option. I think validateIf
is a bit confusing, since you can get it mixed up with the ValidateIf
decorator.
Handy feature, though!
See my recent comment in #1721
updated @braaar
@braaar Please merge this feature I am waiting for so long...
@braaar @aoi-umi What are you guys waiting upon this? Can we please move forward with this?
@braaar @aoi-umi What are you guys waiting upon this? Can we please move forward with this?
haha, i don't know either
We are discussing this feature internally right now. Hold on just a little longer, @kevit-kelvin-mandlik and @aoi-umi
@braaar Are we good to go on this??
Any updates on this PR? I've been looking forward to using this feature for a quite long time!