Packages

Simple, agile, map schema in elixir with type checking, custom types with casting and validation and with json encoding

Current section

Files

Jump to
map_schema lib example person.ex
Raw

lib/example/person.ex

defmodule MapSchema.Examples.Person do
@moduledoc """
Person example
"""
use MapSchema,
schema: %{
"name" => :string,
"surname" => :string,
"country" => :string,
"lang" => :language_iso639,
"age" => :integer,
"contact" => %{
"email" => :string,
"phone" => :string,
"others" => :any
}
},
custom_types: [
MapSchema.Examples.CustomTypeLang
]
end