Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

Parameter verification How to customize error messages #1151

Open
0x0bit opened this issue Dec 13, 2024 · 1 comment
Open

Parameter verification How to customize error messages #1151

0x0bit opened this issue Dec 13, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@0x0bit
Copy link

0x0bit commented Dec 13, 2024

Question

After I have defined the dto, how should I customize the error message for some attribute validation, for example, I have a username attribute, the minimum length is 6, if the length is not reached, the error message provided to the user is that the username must be more than 6 characters

export class CreateManagerDto {
  /**
   * 用户名,必须是唯一的。
   * 例如:`john_doe`
   */
  username: string & tags.MinLength<6>;
}

But now the error message is this:
image

thanks!!!

@samchon samchon added the duplicate This issue or pull request already exists label Dec 13, 2024
@samchon
Copy link
Owner

samchon commented Dec 13, 2024

Not possible in typia and nestia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants