xema v0.1.1 Xema.Map View Source

This module contains the struct for the keywords of type map.

Usually this struct will be just used by xema.

Examples

iex> import Xema
Xema
iex> schema = xema :map
%Xema{type: %Xema.Map{}}
iex> schema.type == %Xema.Map{}
true

Link to this section Summary

Types

t()

The struct contains the keywords for the type map

Link to this section Types

Link to this type t() View Source
t() :: %Xema.Map{additional_properties: boolean() | nil, as: atom(), dependencies: list() | map() | nil, keys: atom() | nil, max_properties: pos_integer() | nil, min_properties: pos_integer() | nil, pattern_properties: map() | nil, properties: map() | nil, required: MapSet.t() | nil}

The struct contains the keywords for the type map.

  • additional_properties disallow additional properties, if set to true
  • as is used in an error report. Default of as is :list
  • dependencies allows the schema of the map to change based on the presence of certain special properties
  • keys could be :atoms or :strings
  • max_properties the maximum count of properties for the map
  • min_properties the minimal count of properties for the map
  • pattern_properties specifies schemas for properties by patterns
  • properties specifies schemas for properties
  • required contains a set of required properties