im using nestjs-i18n in my dto and it just throw bad request error instead of my error 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?
the best way: 1)you can use this code in your main.ts
2)and in your classDto code is
3)in your controller
4)in your i18n folder file like:fa.json