Package

examples

validation

Permalink

package validation

Visibility
  1. Public
  2. All

Type Members

  1. case class Person(gender: Option[String], experience: Int) extends Product with Serializable

    Permalink
  2. case class SchoolClass(pupils: Int, teacher: Person) extends Product with Serializable

    Permalink

Value Members

  1. object CollectErrors extends App

    Permalink
  2. object CrossFieldValidation extends App

    Permalink

    This example shows how to apply cross-field validation rules for the request using a for comprehensions and the "Extraction" construct.

    This example shows how to apply cross-field validation rules for the request using a for comprehensions and the "Extraction" construct. The comprehension returns an Extracted, or ExtractionFailed instance. Note that the Extractables can be nested in other Extractables, which allows for re-use and compartmentalisation of validation logic.

    In this example, we implement a checker for school class sizes.. the rule being that the number of pupils in a class must be greater than their teacher's years of experience.

Ungrouped