Validate.Util (Validate v1.3.1)
Utilities to help with validation
Summary
Functions
Turns an array of %Validate.Validator.Error{} structs into a keyed map of errors
Functions
Link to this function
errors_to_map(errors)
Turns an array of %Validate.Validator.Error{} structs into a keyed map of errors
Examples
iex> {:error, errors} = Validate.validate(%{"name" => ""}, %{"name" => [required: true]})
iex> %{"name" => ["is required"]} == Validate.Util.errors_to_map(errors)