themis.validators documentation

from-predicate

(from-predicate f)(from-predicate f response-data)(from-predicate f arg-data & more-data)
Given a predicate function that takes a single arg,
return a proper validation function for it.
You can also abuse this for predicates that take multiple arguments;
The data-point arg is expected to be your first arg (otherwise you should
just use partial).

non-empty

(non-empty t data-point opt-map)
Determine if the data-point is non-empty;
If there is a non-empty value present at a specific coordinate.

presence

(presence t data-point opt-map)
Determine if the data-point is non-nil;
If there is a value present at a specific coordinate.
Note: `presence` does not imply `required` - you could fail here because
the coordinate doesn't actually exist.

required

(required t data-point opt-map)
Determine that the coordinate exists in the data structure

response

(response response-data)(response response-data opt-map)
Resolve and return a validator's response;
The value of :response in the opt-map, the response-data passed directly
to the `response` fn or the default return via *default-response*