In Ecto 3.x, you can implement embed_as/1 and return :dump. If you do so, Ecto will call YourCustomType.dump/1 before JSON serialization when saving embedded schema into DB. On the other hand, if embed_as/1 returns :self, then Ecto won’t call dump before JSON serializing an embed.






















