API Reference Parameter v0.7.1
modules
Modules
Parameter
is a library for dealing with complex datatypes by solving the following problems
Enum type represents a group of constants that have a value with an associated key.
The field inside a Parameter Schema have the following structure
Custom types for fields can be done by implementing the Parameter.Parametrizable
behaviour.
This is useful when the basic types provided by Parameter.Types
are not enough for loading, validating and dumping data.
The first step for building a schema for your data is to create a schema definition to model the external data.
This can be achieved by using the Parameter.Schema
macro. The example below mimics an User
model that have one main_address
and a list of phones
.
Parameter supports different types to be used in the field inside a schema. The available types are
Any parameter type. It will accept any input value without validations. The same value loaded will be the same dumped.
Atom parameter type
Boolean parameter type
Date parameter type
DateTime parameter type
Decimal parameter type. Include the Decimal library on your application to use this type
Float parameter type
Integer parameter type
List parameter type
Map parameter type
NaiveDateTime parameter type
String parameter type
Time parameter type
Common validators to use within fields of the Parameter.Schema