Closed webblin034 closed 3 years ago
use this validator:
implicit val inputDataValidator: Validator[InputData] = validator[InputData] { request =>
request.id is notBlank
request.name.each is notBlank
request.description.each is notBlank
request.items is notEmpty // <=== Only Check Last Assertion
}
Official Document : " Accord supports several native Scala control structures, notably ifs and pattern matching " in http://wix.github.io/accord/dsl.html
Library Dependencies :
Input Data :
Unit Test :
Test Failed Due To Only Checking Last Validation Rule !