2

request response can be validated using javax annotation. However, need some help to have fixed length validation, as @Size(min=3, max=3). It is having message that 'size must be between 3 and 3'. This is required to be changed.

2
  • What is the problem? Do you want to change the message? Commented Feb 9, 2021 at 15:08
  • Yes you are right Commented Feb 10, 2021 at 8:35

1 Answer 1

1

If you want to change the default @Size message just declare parameter message into:

@Size(min = 3, max = 3, message = "Your constraint message")
private int anyNumber;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.