This will transform a list of accumulated errors to a JSON body that's usable as a response format.
This will transform a list of accumulated errors to a JSON body that's usable as a response format. From a non empty liust of errors this will produce something in the following format:
{ "error": { "code": 400, "messages": [ "this is an error message", "this is another error message ] } }