我有这堂课:
class SomeDto {
@ArrayMaxSize(100)
@Type(() => NestedDto)
@ValidateNested({ each: true })
nested: NestedDto[];
}
我使用验证管道作为:
@Body(new ValidationPipe({ transform: true })) { nested }: NestedDto,
它正确地进行了验证,但我每次都得到一个空的错误数组。
{
"statusCode": 400,
"message": "Bad Request",
"error": []
}