Safe validation boundary for registered operation input, output and updates.
Validators declared on an operation spec may be primitive type atoms
(:map, :binary, …), a module exporting validate/1, or an explicit
{module, function} pair. Custom validators are invoked defensively: a
missing module, a raise or a throw becomes a tagged {:error, reason}
instead of crashing the caller.
Summary
Functions
Checks that value belongs to a declared domain of allowed values.
Validates value against a declared validator.
Functions
Checks that value belongs to a declared domain of allowed values.
A nil domain accepts everything.
Validates value against a declared validator.
A nil validator accepts everything. Custom validators may reply with
:ok, true, {:ok, _}, false or {:error, reason}; any other reply
is reported as {:error, {:invalid_operation_validation_reply, ...}}.