View Source AnyJson.Codec behaviour (AnyJson v0.1.0)
Defines the callbacks that the adapters must implement.
Link to this section Summary
Callbacks
Decodes a JSON value into an Elixir term. Returns a tuple with {:ok, term}
or {:error, reason}
.
Decodes a JSON value into an Elixir term. Raises an exception if any errors happend.
Encodes any value into a valid JSON. Returns a tuple with {:ok, json}
or {:error, reason}
.
Encodes any value into a valid JSON. Raises an exception if any errors happend.
Link to this section Callbacks
Decodes a JSON value into an Elixir term. Returns a tuple with {:ok, term}
or {:error, reason}
.
Decodes a JSON value into an Elixir term. Raises an exception if any errors happend.
Encodes any value into a valid JSON. Returns a tuple with {:ok, json}
or {:error, reason}
.
Encodes any value into a valid JSON. Raises an exception if any errors happend.