validex v0.6.1 Validex.Validators.Type

The Type validator is used for validating types of values.

Examples

iex> Validex.Validators.Type.validate(:type, :name, :string, "Simon", [])
[{:ok, :name, :type}]

iex> Validex.Validators.Type.validate(:type, :name, :string, 5, [])
[{:error, :name, :type, "name should be string but was integer"}]

Summary

Functions

expand(type_shorthand)

Callback implementation for Validex.RuleExpander.expand/1.

rule_kind()

Callback implementation for Validex.Validator.rule_kind/0.

validate(_, attribute, expected_type, value, _)

Callback implementation for Validex.Validator.validate/5.