That’s a misunderstanding of what Ecto.Changeset.cast/4 is about though. cast is about taking in external data, which has not been typecast to internal datatypes. It’s the whole schema version of Ecto.Type.cast. When you got structs of your data you’re past that step. You’re no longer dealing with unknown input. You can just use Ecto.Changeset.change/2 or Ecto.Changeset.put_change/3 instead to skip any requirement of having a map or any typecasting – which is no longer necessary anyways.






















