{"id":239,"date":"2018-10-29T16:06:42","date_gmt":"2018-10-29T16:06:42","guid":{"rendered":"https:\/\/packlane.com\/blog\/?p=239"},"modified":"2018-10-29T16:06:42","modified_gmt":"2018-10-29T16:06:42","slug":"using-ecto-changeset-for-data-validation","status":"publish","type":"post","link":"https:\/\/packlane.com\/blog\/using-ecto-changeset-for-data-validation\/","title":{"rendered":"Using Ecto.Changeset for data validation"},"content":{"rendered":"\n

Ecto<\/code><\/a>, while commonly used as a database wrapper, can also serve as a powerful data validation tool thanks to its Ecto.Changeset<\/code><\/a>.<\/p>\n

Let’s say you have a list of movie data that you want to clean up and put into a nice %Movie{}<\/code> struct that would consist of the following fields:<\/p>\n