Replies: 1 comment
-
Hi Mahramane, You can group the violations by their path, which will allow you to write the following code: val result = validateBook(book)
when (result) {
is ValidationResult.Failure -> {
val failedPaths = result.violations.byPath.keys
if (failedPaths.contains(listOf("author", "fullName"))) {
println("The path author.fullName failed")
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
how can i check that path is in list or vararg of values?
Beta Was this translation helpful? Give feedback.
All reactions