Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 432 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 432 Bytes

Kotlin Validation

Clean validation library for Kotlin with a convenient DSL for creating validators.


Simple Example

val validateUser = validate<User> {
    User::firstName {
        notBlank()
    }
    
    User::lastName {
        notBlank()
    }
}

val result = validateUser(User("", ""))
result.valid // false
result[User::firstName] // listOf(ValidationError(PropertyPath("firstName"), "must not be blank"))