I have a keyword list of Ecto changeset errors I'd like to convert to a map so that the Poison JSON parser can correctly output a list of validation errors in the JSON format.
I get a list of errors as follows:
[:topic_id, "can't be blank", :created_by, "can't be blank"]
...and I'd like to get a map of errors like so:
%{topic_id: "can't be blank", created_by: "can't be blank"}
Alternatively, if I could convert it to a list of strings, I could use that as well.
What is the best way to accomplish either of these tasks?