Given a DTO with a following property definition:
class Dto {
@Expose()
@IsDefined()
@ValidateNested({ each: true })
@Type((unit) => CustomType)
props: CustomType[]
}
and CustomType e.g.
export class CustomType {
@Expose()
@IsString()
@IsUUID()
id: string
}
an input object:
{
"props": []
}
will yield such an error from ValidationPipe:
{
"statusCode": 400,
"message": [
"0.id must be an UUID",
"0.id must be a string",
],
"error": "Bad Request"
}
It is not clear at the moment which property is triggering a validation error (in case of many array type properties).
I'd go with something like:
{
"statusCode": 400,
"message": [
"props.0.id must be an UUID",
"props.0.id must be a string",
],
"error": "Bad Request"
}
Looks like it will be related to this. Would you like to work on a PR?
@jmcdo29 @pbn4 I would like to work on a PR if that is okay.
Thanks for reporting! PRs are more than welcome @princechauhan1992 @pbn4 :)
Ping @princechauhan1992 馃彄
@kamilmysliwiec I apologize for the delay. Will create a pr this weekend.
Most helpful comment
@jmcdo29 @pbn4 I would like to work on a PR if that is okay.