How to work with this API


The API that I’m working with doesn’t key stuff the way ember wants. Here is a screenshot of the API:

Everything is under the key “data”. I’ve played around with Serializers and Adapters. Any help would be greatly appreciated.


So far I’ve got this to try and change to the data key, but it’s not working:

import DS from "ember-data";

export default DS.RESTSerializer.extend({
  normalizeArrayResponse: function(store, primaryModelClass, payload, id, requestType) {
    var pluralTypeKey = Ember.String.pluralize(requestType.typeKey);
    payload[pluralTypeKey] = payload['data'];
    delete payload['data'];

    return this._super(store, primaryModelClass, payload, id, requestType);


Not sure if you’re already finished up with this, but given that you’ve already got a data attribute, it might make the most sense to build a custom Serializer based on JSONAPI. It’s the wave of the Ember future and you’re already about half-way there.

More details are available here ( and I’ve got a sample commit you can look at here ( from when I was learning how to build a serializer for JSONAPI

That help?