Want.Shape (want v1.14.0)
Provides macros for declaring an Ecto-like schema definition that can be used
to cast incoming data. Most of the macro logic here was adapted from Ecto.Schema.
Link to this section Summary
Functions
Cast incoming data based on a Shape definition.
Cast incoming data based on a Shape definition. Raises on error.
Define a field within a shape.
Define a schema. Generates a struct definition for the current module that includes the data needed to correctly cast incoming JSON/map data into that struct, including field sourcing, type conversions, etc.
Link to this section Functions
cast(shape, data)
Specs
Cast incoming data based on a Shape definition.
cast!(shape, data)
Specs
Cast incoming data based on a Shape definition. Raises on error.
Define a field within a shape.
Define a schema. Generates a struct definition for the current module that includes the data needed to correctly cast incoming JSON/map data into that struct, including field sourcing, type conversions, etc.