conform v2.5.2 Conform.Type behaviour

Defines the behaviour for custom types.

Summary

Callbacks

Converts the .conf value to this data type. Should return the translated value or {:error, reason}

Return a string to produce documentation for the given type based on it’s valid values (if specified). If nil is returned, the documentation specified in the schema will be used instead (if present)

Callbacks

convert(term, arg1)
convert(term, Conform.Schema.Mapping.t) ::
  {:ok, term} |
  {:error, term}

Converts the .conf value to this data type. Should return the translated value or {:error, reason}

to_doc(term)
to_doc(term) :: nil | String.t

Return a string to produce documentation for the given type based on it’s valid values (if specified). If nil is returned, the documentation specified in the schema will be used instead (if present).