I have a class ```data class Login(@get:NotBlank @...
# announcements
r
I have a class
Copy code
data class Login(@get:NotBlank @get:Size(min=3) @JsonProperty(value = "login", required = true) val login: String, 
                  @get:NotBlank @JsonProperty(value = "password", required = true) val password: String)
annotations are used for validation, validation is executed after constructor but before validation, I need to trim
login
and
password
, in order to reject values as " r " for
login
, because real value is "r" and size is 1, which is less than 3 how to do this in Kotlin? Thread in Slack Conversation you can try:
Copy code
class Login(login: String, password: String){
    @get:NotBlank @get:Size(min=3) @JsonProperty(value = "login", required = true) val login: String = login.trim()
    @get:NotBlank @JsonProperty(value = "password", required = true) val password: String = password.trim()
}