Skip to content

colinmorelli/kotlin-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"))

About

Kotlin DSL for validation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages