Best Practice for Mapping API Response Data to a Module using Ecto.Schema

Hi everyone :slight_smile:

I’ve been playing around with Elixir and Phoenix 1.3 and in one of the apps i have a module responsible for fetching data from Weather API and a couple of modules using Ecto.Schema all within the same Context.

As the API response map is very different from what i’ll need to cast into the Modules with Ecto, i’ve questioned myself on what it is the best place to add the functions for these transformations so i pass a valid map to the changesets.

1 Like