richeterre / jumubase

A friendly monolith for managing "Jugend musiziert" contests ♫
MIT License
3 stars 0 forks source link

Replace Poison with Jason [WIP] #6

Closed richeterre closed 3 years ago

richeterre commented 5 years ago

Since Jason requires an explicit @derive where we specify which fields will be encoded, my initial idea was to whitelist the fields in one place (the ecto_encoders.ex file) instead of spread around schema files.

However, a much nicer solution would be to write a function that takes in a %Performance{} struct and recursively

Unfortunately, I can't figure out how to write such a filter since Elixir structs don't implement the Enumerable protocol 😕

richeterre commented 3 years ago

Closing this as it's made obsolete by #26 🥳