DS.RESTSerializer without root keys

Previously, to deal with the API I am using without root keys, I was using this:

ApplicationSerializer = DS.RESTSerializer.extend({
  normalizePayload: function(type, payload) {
    var typeKey = type.typeKey;
    var value = {};
    value[typeKey] = payload;
    return value;
  }
});

This works with Ember Data 1.0.0-beta.7+canary.b45e23ba, but not Ember Data 1.0.0-beta.8.2a68c63a.

normalizePayload now takes just a payload.

What is the new way to handle this?

Pasting our IRC conversation here:

3:12 PM <igorT__> afaik, the main difference between restSerializer and jsonSerializer is that the Rest one supports sideloading

3:12 PM <igorT__> if you don’t have keys, you can’t sideload

3:12 PM <igorT__> so have you tried using jsonSerializer?

1 Like

UPDATE: Switching to JSONSerializer just worked for me.