xema v0.11.0 Xema.Validator behaviour View Source

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

Link to this section Summary

Functions

Validates data against the given schema.

Callbacks

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

Link to this section Types

Link to this type

result()

View Source
result() :: :ok | {:error, map()}

Link to this section Functions

Link to this function

validate(schema, data)

View Source
validate(Xema.Behaviour.t() | Xema.Schema.t(), any()) :: result()

Validates data against the given schema.

Link to this section Callbacks

Link to this callback

validate(any)

View Source
validate(any()) :: :ok | result()

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