Speck.ValidationMetadata.Attribute (speck v4.0.1)

Work with validation metadata attributes

Summary

Functions

Returns a list of metadata attributes.

Merge the values from metadata attributes into a given map.

Types

t()

@type t() ::
  {path :: [String.t() | non_neg_integer()],
   status :: :present | :not_present | :unknown, raw_value :: term()}

Functions

list(meta)

@spec list(meta :: Speck.ValidationMetadata.t()) :: [t()]

Returns a list of metadata attributes.

merge(attributes, params, opts \\ [])

@spec merge(
  attributes :: [t()],
  params :: map(),
  opts :: [{:merge_strategy, :param_priority | :attribute_priority}]
) :: map()

Merge the values from metadata attributes into a given map.

Opts

  • :merge_strategy - Determines whether a value in the params or attributes takes priority when both are present. Defaults to :param_priority.