-
-
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
[Docs] DS.RESTSerializer needs update #4186
Comments
For some context: |
Sorry @bmac, had to make a quick issue regarding this so I wouldn't forget. I may have time to tackle this soon. May not tho. |
@James1x0 I've just realized that |
@jsangilve It threw a warning in ED 1.x, I think it's supposed to be completely gone from the api in 2.x |
@James1x0 it's gone from the API, but it seems like the normalize(modelClass, resourceHash, prop) {
if (this.normalizeHash && this.normalizeHash[prop]) {
this.normalizeHash[prop](resourceHash);
}
return this._super(modelClass, resourceHash, prop);
}, If you create a normalizeHash property while extending DS.RESTSerializer, it will work. I just created a PR that only solves the docs issue. |
There is a deprecation warning in Since it has been deprecated in Unfortunately this would be a breaking change since this seems to be used, as pointed out by @jsangilve. There is also a test for this. So I think the correct way would be to deprecate this path again and remove it in |
@pangratz I agree. I can open a new PR to include the deprecation message and new tests without normalizeHash. I think it should be some like: normalize(modelClass, resourceHash, prop) {
if (this.normalizeHash) {
Ember.deprecate('`RESTSerializer.normalizeHash` has been deprecated. Please use `serializer.normalize` to modify the payload of single resources.');
if (this.normalizeHash[prop]) {
this.normalizeHash[prop](resourceHash);
}
}
return this._super(modelClass, resourceHash);
}, |
@jsangilve I will check the next steps here and get back to you regarding that PR. But basically it would be the same as here (also with |
Solves #4186 and fixes `this._super` call within `normalize` method.
@jsangilve I am very sorry, but I completely forgot to get back to you here 😢 In the meantime this has already been addressed in #4258. |
No problem @pangratz. Just let me know if the deprecation path discussed above is approved. I'll be more than glad to PR with new tests. |
@pangratz Oh, now I see it has been already fixed. Awesome! |
normalizeHash is deprecated, Parse is going extinct.
The text was updated successfully, but these errors were encountered: