Rule

com.eclipsesource.schema.internal.validation.Rule
See theRule companion object
trait Rule[I, O] extends RuleLike[I, O]

Attributes

Companion
object
Graph
Supertypes
trait RuleLike[I, O]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def repath(f: JsPath => JsPath): Rule[I, O]

This methods allows you to modify the Path of errors (if the result is a Failure) when aplying the Rule

This methods allows you to modify the Path of errors (if the result is a Failure) when aplying the Rule

Attributes

def |+|[OO <: O](r2: RuleLike[I, OO]): Rule[I, O]

Create a new Rule the validate this Rule and r2 simultaneously If this and r2 both fail, all the error are returned

Create a new Rule the validate this Rule and r2 simultaneously If this and r2 both fail, all the error are returned

 val valid = Json.obj(
    "firstname" -> "Julien",
    "lastname" -> "Tournay")
 val composed = notEmpty |+| minLength(3)
 (Path \ "firstname").read(composed).validate(valid) // Success("Julien")

Attributes

Inherited and Abstract methods

def validate(data: I): VA[O]

Apply the Rule to data

Apply the Rule to data

Value parameters

data

The data to validate

Attributes

Returns

The Result of validating the data

Inherited from:
RuleLike