添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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.