I have an old codebase where I want to delete some of the json renderers in favor of automatic rendering via json encoders.
I have tried to add Jason.Encoder
like this:
@derive {Jason.Encoder, only: [:id, :description]}
schema "items" do
But I get an error like cannot encode metadata from the :__meta__ field
with some suggestion to use @derive {Poison.Encoder, only: [:name, :title, ...]}
If I use the Poison encoder instead of Jason, all works fine BUT, I don’t understand why Jason isn’t working.
I’m on phoenix 1.4.1
so, I expected that since Jason is the default encoder, it should work.
Any idea of what would I need to do in order for Jason to work?