nestjs-i18n in DTO validation just throw bad request error

Viewed 14

im using nestjs-i18n in my dto and it just throw bad request error instead of my messsage.

this is my dto:

export class SignUpDto{
    @ApiProperty()
    @MinLength(5, {
        message: i18nValidationMessage('i18n.MIN', {message: 'err'})
    })
    username:string;
}

and i18n.json file:

{
  "MIN": "You need to write at least 5 letter"   
}

but this is the error in swagger:

{
  "statusCode": 400,
  "message": "Bad Request"
}

what is the problem?

0 Answers
Related