Where Ember Data Does Not Follow JSON API

This is a heads-up for those using Ember Data. As of 1.0.0-beta.7, it doesn’t seem to conform to the following prescription of JSON API for creation of records:

“Its root key MUST be the same as the root key provided in the server’s response to GET request for the collection.” (jsonapi.org)

Also, Ember Data expects:

JSON API prescribes:

Update: The documentation is out of sync with the code, evidently. There seems to be support for “links” but not “linked.”

Advertisements

One thought on “Where Ember Data Does Not Follow JSON API

  1. I can see how Ember’s pattern is more terse and avoids nesting, both good qualities, but there is no clear indicator that post.comments[] is related to root.comments[]. The developer would have to know of the relationship in advance.

    Whereas JSON-API’s standard introduces a nested object, but makes explicit the relationship between everything in post.links and root.linked. A developer need not know which keys have relationships in advance; they need only to relate everything under ‘links’ with ‘linked’.

    Of the two examples provided, which do you prefer? In other words: would you like to see Ember Data conform to the JSON-API standard or vice versa?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s