View Source ExOAPI.Helpers.Casting (ex_oapi v0.1.5)

Link to this section Summary

Link to this section Types

@type key_tuple() :: {valid_key(), valid_key()}
@type valid_key() :: String.t() | atom()

Link to this section Functions

Link to this function

translate(from_map, original_to_final_keys)

View Source
Link to this function

translate(from_map, original_to_final_keys, opts)

View Source
@spec translate(
  final :: map() | {:ok, map()} | {:error, term()},
  from :: map() | [map()],
  [key_tuple()]
) :: {:ok, map()} | {:error, :invalid_args} | {:error, {:missing_key, atom()}}
Link to this function

translate(acc_map, from_map, original_to_final_keys, opts \\ [])

View Source
@spec translate(
  final :: map() | {:ok, map()} | {:error, term()},
  from :: map(),
  [key_tuple()],
  Keyword.t()
) :: {:ok, map()} | {:error, :invalid_args} | {:error, {:missing_key, atom()}}