Update to Poison 1.5. With it you can declare in your models:
@derive {Poison.Encoder, only: [:foo, :bar, :baz]}
schema "your schema" do
field :foo
field :bar
field :baz
end
It is going to be faster, safer and cleaner.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…