View Source API Reference Vx v0.4.0

Modules

Vx

Vx is a schema validation library.

The Any type.

The Atom type.

The Boolean type.

A constraint for a Vx.Type. You can add a constraint to a type using Vx.Type.constrain/3 and Vx.Type.constrain/4.

The Enum type.

An error that is returned or raised when validation fails.

The Float type.

The Inspectable protocol allows converting types to a string representation.

The Integer type.

The Intersect type combines multiple types into a single type, validating whether all of them are valid.

The List type.

The Literal type.

The Map type.

The Match helper checks whether a value matches a pattern. As this relies on macros, you need to require Vx.Match before using it.

The Not type negates the given type or value.

The Nullable type modifies a type or value to allow nil as a valid value.

The Integer type provides validators for integers.

The Optional type provides validators for optional keys in a map. When used in other places, it behaves like Vx.Nullable.

The String type.

The Struct type.

The Tuple type.

A basic type that implements the Vx.Validatable protocol and allows adding constraints to the type definition.

The Union type combines multiple types into a single type, validating whether any of them is valid.

The Validatable protocol that is implemented by all types of the Vx type system. As a fallback, any value not having an implementation for the Vx.Validatable protocol is considered a Vx.Literal when passed to validate/2.

A helper that can be used to validate values using a custom function.