You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Those lines where errors are added to the returned object hide the error details if the API returns an error title. From the standard, the title attribute may be set, but shouldn't ever change from instance to instance of a problem, so including the title tells you only what kind of error happened, not any specifics of it. The detail attribute is also optional but is meant to give details about the error.
The specific error that's causing this for me is a 400 response where the title is "Param not allowed". That's the title that my server is returning, so that's OK, but the detail attribute tells which param it was that wasn't allowed. Without that information the error message is not very helpful, and useful information my API is returning gets thrown out.
Recommend changing that so that it either appends the two together if both are set, displays detail over title (reverse the two terms so that detail takes priority), or allow that to be a setting so users can choose one way or the other. I'm happy to submit a pull request with any of these options but probably the simplest and least objectionable is the first option.
The text was updated successfully, but these errors were encountered:
https://github.com/chingor13/json_api_client/blob/master/lib/json_api_client/resource.rb#L414-L418
Those lines where errors are added to the returned object hide the error details if the API returns an error title. From the standard, the
title
attribute may be set, but shouldn't ever change from instance to instance of a problem, so including the title tells you only what kind of error happened, not any specifics of it. Thedetail
attribute is also optional but is meant to give details about the error.The specific error that's causing this for me is a 400 response where the title is "Param not allowed". That's the title that my server is returning, so that's OK, but the
detail
attribute tells which param it was that wasn't allowed. Without that information the error message is not very helpful, and useful information my API is returning gets thrown out.Recommend changing that so that it either appends the two together if both are set, displays detail over title (reverse the two terms so that detail takes priority), or allow that to be a setting so users can choose one way or the other. I'm happy to submit a pull request with any of these options but probably the simplest and least objectionable is the first option.
The text was updated successfully, but these errors were encountered: