What’s the proper way using ktor validation to ret...
# ktor
m
What’s the proper way using ktor validation to return multiple invalid reasons? Like here I want the status error page plugin to get both reasons if both email and password are blank.
Copy code
validate<LoginRequest> {
        if (it.email.isNullOrBlank()) {
            ValidationResult.Invalid("Email blank")
        }
        if (it.password.isNullOrBlank()) {
            ValidationResult.Invalid("Password blank")
        }
    }
a
You can accumulate the reasons in a list and return a single
ValidationResult.Invalid
with that list.