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.
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.