scheme v0.1.0 Scheme.Validator
Link to this section Summary
Functions
Validates a schema, based on given rules
Link to this section Functions
Link to this function
validate(scheme, rules)
Validates a schema, based on given rules
Parameters
- scheme: String that represents the name of the person.
- rules: Atom representing rules macro created with Scheme.Check.rules/2
Examples
iex> import Scheme.Check
:ok
iex> rules :my_rule do
rule(:key, :string, required: true)
end
:ok
iex> Scheme.Check.validate(%{key: "i'm a string"}, :my_rule)
[] -> as there is no errors