Elixir - Poison

Poison.decode! vs. Poison.Parser.parse!


They seem to produce the same results unless you’re using the more advanced options of Poison.decode!. I guess using Poison.decode! should be alright, although the Readme suggests using Poison.Parser.parse! for simple JSON parsing.

using structs


derive only Protocol.Encoder protocol implementation for encoding the struct:

defmodule Neko.Achievement do
  @derive [Protocol.Encoder]
  defstruct ~w(id name)a

it’s not necessary to derive Protocol.Decoder for decoding into struct (though it won’t raise an error).