You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
By clicking “Sign up for GitHub”, you agree to our
terms of service
and
privacy statement
. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
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
Unable to resolve signature of property decorator when called as an expression.
This expression is not callable.
Type 'Boolean' has no call signatures.
Had the same issue and found out after a few hours that it is a typo.
isNotEmpty
should be
IsNotEmpty
(capital
I
)
Mentioned
here
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.