class-validator icon indicating copy to clipboard operation
class-validator copied to clipboard

fix: support `each` with custom decorators

Open NoNameProvided opened this issue 7 years ago • 1 comments

Custom decorators don't accept the each option. They should.

Note: Changes should be reverted made in #197 after we fixed this.

Created from #197.

NoNameProvided avatar Jul 19 '18 08:07 NoNameProvided

Actually it does work with the validate function, the value passed into it is the correct array element.

What does not work is the "$value" reference in error messages and the value reference in the ValidationArguments is also not correct.

So you can only get the forEach value within the validate function when you use the first function argument, you will have to ignore the value in the ValidationArguments (second function argument).

elovin avatar Feb 07 '24 21:02 elovin