validex v0.1.0 Validex

Documentation for Validex.

Summary

Functions

Verify data against schema returning only invalid validations

Verify data against schema returning true if no erros were found

Verify data against schema returning both valid and invalid validations

Functions

errors(data, schema)

Verify data against schema returning only invalid validations

Examples

iex> Validex.errors(%{ name: 5 }, [name: :string])
[{:error, :name, :type, "name should be string but was integer"}]
valid?(data, schema)

Verify data against schema returning true if no erros were found

Examples

iex> Validex.valid?(%{ name: "simon" }, [name: :string])
true

iex> Validex.valid?(%{ name: 455 }, [name: :string])
false
verify(data, schema)

Verify data against schema returning both valid and invalid validations.

Examples

iex> Validex.verify(%{ name: 5 }, [name: :string])
[{:ok, :name, :presence}, {:error, :name, :type, "name should be string but was integer"}]