Destructuring JSON validator/converter for Erlang