-
Notifications
You must be signed in to change notification settings - Fork 830
Open
Labels
type: fixIssues describing a broken feature.Issues describing a broken feature.

Description
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
- nodejs: v12.17.0
- typescript: 3.9.5
cduff, iwpnd, nerdyman, jacob-regan-tempus, josephdpurcell-five9 and 2 more
Metadata
Metadata
Assignees
Labels
type: fixIssues describing a broken feature.Issues describing a broken feature.