Open
Description
Hi,
As I noted in this commit, there are some behavioural changes that are not very obvious and perhaps should either be reverted or documented.
Essentially, in ErrorFormatter::Json
, the old behaviour (our app was on grape v0.10.1
) was to:
- pass on a
Hash
as it is, or; - wrap the error object (can be a string or array, etc - anything other than a hash) with
{ error: original_error_object }
The commit linked has unfortunately changed this behaviour to be:
- wrap the error object with
{ error: original_error_object }
ONLY IF the error object is aString
, or; - anything else (a hash or an array, etc) will be passed on as they are
I have checked the test changes in the same commit, as well as the changelog, and I could not see any obvious reference to this behavioural change.
I would love to know more about the intention behind this change, and see we either revert or document this change accordingly.
Hope that makes sense. Thanks everyone!