I want to be able to use the public attributes of a resource for @derive {Jason.Encoder, only: [:foo]}
.
- Is this possible without manually listing the atoms of the attributes? I’ve been able to get a list of the attributes programmatically by using
Ash.Resource.Info(__MODULE__) |> &Enum.map(&1, :name)
but unable to use that with@derive
(I’m guessing due to compilation order.) - Can it be done using a macro to avoid having to add it to every resource I want to use it with?