class-validator
class-validator copied to clipboard
fix: Unable to resolve signature of property decorator when called as an expression.
Description
Use Class-Validator in DTOs
Minimal code-snippet showcasing the problem
@isNotEmpty({ message: '' }) // ts error
@ApiProperty({ description: '手机号', example: '13222222222', required: true })
phone: number;
Actual behavior
ts: Unable to resolve signature of property decorator when called as an expression. This expression is not callable. Type 'Boolean' has no call signatures.
same problem with me!
Had the same issue and found out after a few hours that it is a typo.
isNotEmpty
should be IsNotEmpty
(capital I
)
Mentioned here
thank you
As mentioned by others, the decorators start with a capital letter: @IsNotEmpty
. The isNotEmpty
is the validator function that is used by the decorator.
Closing this as there is no action to take.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.