kurko / ember-json-api

JSON API adapter for Ember Data.
MIT License
254 stars 62 forks source link

Need to replace "data" with key for type? #75

Closed andrewbranch closed 9 years ago

andrewbranch commented 9 years ago

Maybe I'm just doing something wrong, but this package isn't working for me. My very simple server response looks like

{"links":{"self":"http://localhost:8080/api/bulletins"},"data":[]}

and Ember fails while warning me Encountered "data" in payload, but no model was found for model name "datum".

If, during, the serialization, I do

payload.bulletins = payload.data;
delete payload.data;

it works. Am I missing something, or are you?

jonkoops commented 9 years ago

@andrewbranch It looks like the response of your API conforms to the RC3 version of the specification, but the latest version of ember-json-api still only supports RC1. If you want to try out a version that supports RC3 of the specification please use this pull request. Note that the pull request is very much a WIP if you find any issues please report them there.

andrewbranch commented 9 years ago

Awesome, thanks for pointing me in the right direction! I'm happy to try the PR and contribute to moving it forward wherever I can.