#How to serialize ecto Struct into json
5 messages · Page 1 of 1 (latest)
yes, there is, assuming you're using jason as your JSON encoder: https://hexdocs.pm/jason/Jason.Encoder.html
I wanted to do it without manual implementations of the serialization.
Just wanted to place something like
@derive {Jason.Encoder, except: [:__meta__]}
it works exactly like that... are you having trouble getting it to work?
If you're using ecto, you can place that right above the schema declaration.