Description
From the docs:
If a property is redefined in the descendant class decorators will be applied on it both from that and the base class.
I'm not sure it works as it should.
Reproduction
import { MinLength, IsUppercase } from "class-validator";
import { validate } from "class-validator";
class BaseClass {
@MinLength(10)
someProperty: string;
}
class ChildClass extends BaseClass {
@IsUppercase()
someProperty: string;
}
const someObj = new ChildClass();
someObj.someProperty = 'HELLO';
validate(someObj).then(result => {
console.log(result);
});
// the output is empty array []
From what I'm reading in docs, I thought @MinLength(10) is used alongside @IsUppercase(), but I don't see it. Moreover, I'm not sure what empty array means.
Environment
Description
From the docs:
If a property is redefined in the descendant class decorators will be applied on it both from that and the base class.
I'm not sure it works as it should.
Reproduction
From what I'm reading in docs, I thought
@MinLength(10)is used alongside@IsUppercase(), but I don't see it. Moreover, I'm not sure what empty array means.Environment