API Reference data_schema v0.5.0

Modules

Data schemas are declarative descriptions of how to create a struct from some input data. You can set up different schemas to handle different kinds of input data. By default we assume the incoming data is a map, but you can configure schemas to work with any arbitrary data input including XML and json.

The casting function can either be a 1 arity function or a module that has a cast/1 function implemented. This behaviour is to help ensure that cast/1 function looks the way DataSchema expects.

An error for when a casting function does not return the correct data.

Defines how DataSchema.to_struct/2 should access data for each given field type.

When we create a struct we either return the struct we were creating or we return this error. The error/errors that happened during struct creation are collected into this struct

An error for when a casting function does not return the correct data.

An error for when a schema is specified incorrectly. Usually this means there has been a syntax error when defining the schema.

Defines a way to use elixir maps as an input data source. This will Map.get/2 the fields from the source data, meaning it will return nil in the case of the key being missing.