ExBankID.Json.Handler behaviour (ex_bank_id v0.2.2) View Source

The expected behaviour a module capable of encoding and decoding json

Link to this section Summary

Callbacks

An implementation of this should decode the given json string to the equivalent elixir value.

An implementation of this should decode the json string into the given struct. Keys missing in the json string should not result in an error.

Link to this section Callbacks

Specs

decode(json :: String.t()) :: {:ok, any()} | {:error, String.t()}

An implementation of this should decode the given json string to the equivalent elixir value.

Specs

decode(json :: String.t(), target :: struct()) ::
  {:ok, struct()} | {:error, String.t()}

An implementation of this should decode the json string into the given struct. Keys missing in the json string should not result in an error.

Specs

encode!(payload :: struct()) :: String.t()