defaultViolationMessage
The default message for failed constraints.
Built-in constraints always override the default message:
Validator<String> {
isNotEmpty() // Message: Must not be empty
}
Content copied to clipboard
However, inline constraints use the default message if not overriden:
Validator<Any> {
constrain { false } // Message: The value is invalid
}
Content copied to clipboard
You can always override the message by using otherwise.