-
Notifications
You must be signed in to change notification settings - Fork 844
Closed
Labels
status: done/releasedIssue has been completed, no further action is needed.Issue has been completed, no further action is needed.type: featureIssues related to new features.Issues related to new features.
Description
Description
This issue us copied and modified from PR #635 by @ytetsuro,
Currently, the @IsNotEmptyObject decorator allows objects with null values only. I would like an option for the @IsNotEmptyObject decorator to fail validation when all object property is null or undefined.
Proposed solution
Minimal example of proposed feature:
class MyClass {
@IsNotEmptyObject()
notStrictModeInvalid = { }; // invalid
@IsNotEmptyObject()
notStrictModeValid = { key1: null, key2: undefined }; // valid
@IsNotEmptyObject({ nullable: false })
strcitModeInvalid = { }; // invalid
@IsNotEmptyObject({ nullable: false })
strcitModeValid = { key1: null, key2: undefined }; // invalid
@IsNotEmptyObject({ nullable: false })
strcitModeValid = { key1: 'key', key2: undefined }; // valid
}Metadata
Metadata
Assignees
Labels
status: done/releasedIssue has been completed, no further action is needed.Issue has been completed, no further action is needed.type: featureIssues related to new features.Issues related to new features.