View Source Xema.Validator behaviour (xema v0.17.1)

This module contains all validators to check data against a schema.

Summary

Callbacks

A callback for custom validators. For an example see: Custom validators

Functions

Validates data against the given schema.

Types

@type result() :: :ok | {:error, map()}

Callbacks

@callback validate(any()) :: :ok | result()

A callback for custom validators. For an example see: Custom validators

Functions

@spec validate(Xema.Behaviour.t() | Xema.Schema.t(), any()) :: result()

Validates data against the given schema.