-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 6.1's ActiveModel Errors Revamp breaks error response #33
Comments
@KubaSemczuk Thanks for reporting this! Do you opt for a PR? :) |
Hi. I'm not sure I'm ready for it skillwise (meaning I'm afraid it would take me ages and I won't have that much free time in next few weeks). I've never contributed to any gem. But I'll take a look at it on the weekend. Can't say I opt for it for now. |
Ok, let me know how it's going! |
Sorry for not getting back to you. Life got in the way and I forgot. I have to say that I won't have time to take care of that in nearest future. |
No worries, added to my todos |
im in rails 6 as well and overwriting the class JsonapiErrorsHandler::Errors::Invalid
def serializable_hash
errors_array = []
errors.to_h&.each do |error|
errors_array << {
status: status,
title: title,
detail: "#{error[0]} #{error[1]}",
source: { pointer: "/data/attributes/#{error[0]}" }
}
end
errors_array
end
end now im getting something like this
this is the full commit of my project if someone want to see |
Resolved in: 2de8338 |
Rails 6.1 changed how ActiveModel errors are structured (explanation, Pull Request). It affects
jsonapi_errors_handler
error output.Error that looked like that:
now looks like that:
So information what error is about is lost.
The text was updated successfully, but these errors were encountered: