-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ActiveModelSerializer errors hash expecting camelcased properties instead of underscored properties in beta.17 #3067
Comments
Just found that there is a test for this in the suite so I'm gonna make sure it isn't something on my end. Has anyone else seen this issue? |
Does anyone know how to get the test here https://github.com/emberjs/data/blob/master/packages/activemodel-adapter/tests/integration/active-model-serializer-test.js#L332 to run? |
Looks like this is related to changes I made in #3036. Can you post the body of your |
I think you're right, this seems buggy: http://emberjs.jsbin.com/kegiqusibi/1/edit?html,js,output. Clicking on save in this JSBin should print the errors under the |
I haven't dug in to the source enough to completely understand your conclusion, but the 422 response you used in your JSBin is almost identical to the response in my project's test. What seems slightly more alarming to me at this point is that I don't think the test I mention above is running when executing |
I'm running the tests by starting The behavior for the passed payload to |
Ok, that is very re-assuring, I was just able to do the same. Thanks! |
@jimmay5469 a quick patch before this is fixed upstream in ember-data would be: DS.JSONSerializer.reopen({
extractErrors: function(store, typeClass, payload, id) {
if (payload && !payload.errors) {
// JSONSerializer only normalizes the keys of
// the `errors` property of the payload
payload.errors = payload;
}
return this._super.apply(this, arguments);
}
}); |
Much appreciated @pangratz! |
I'll be putting together a pull request to address this shortly. |
👍 |
@pangratz @bdvholmes hate to bother y'all on the weekend but i'd love to release beta.18 with a fix on monday. |
I'm putting the fix together tomorrow, does that give you enough time? Enviado desde mi iPhone
|
When I upgrade to beta.17 my tests for server-side errors begin failing to show up, specifically errors for properties which are more than one word (
first_name
fails,email
doesn't). I tried changing the response in the test tofirstName
and they began showing up again.The text was updated successfully, but these errors were encountered: