I'm familiar with the old ember-data "sideloading" model, which would look like this: ```
{
authors:[
{id:1, name:"Ernest", type: 'author', books: [1,2]
],
books: [
{id:1, name: "For whom the bell tolls", type: 'book', author:1},
{id:2, name: "Farewell To Arms", type: 'book', author:1}
]
}
But the new JSON-API method is different.
For one thing, (and I like this), attributes are separated from the id and type information, preventing namespace collisions.
I don't yet understand how to do a hasMany
relationship with the JSON-API format. Can anyone point me to a doc or article on how this is expected? The examples on the JSON-API page show individual relationships, but not hasMany
.
If you could write the above example in the new format, you'd have answered my question.