If I have code such as the following:
new JSONAPISerializer('users', data, {
apiEndpoint: 'http://localhost:3000/api/users',
attributes: ['firstName', 'lastName', 'books'],
books: {
ref: '_id',
attributes: ['title', 'ISBN']
}
}).then(function (users) {
// `users` here are JSON API compliant.
});
{
"links": {
"self": "http://localhost:3000/api/users"
},
"data": [{
"type": "users",
"id": "1",
"attributes": {
"firstName": "Sandro",
"lastName": "Munda"
},
"relationships": {
"books": {
// Is there add a links attribute such as this one for relationships?
"links": {
"self": "http://example.com/users/1/relationships/books",
"related": "http://example.com/users/1/books"
},
"data": [
{ "type": "books", "id": "1" },
{ "type": "books", "id": "2" }
]
}
}
}
Is there a way I can add the links attribute for compound documents?
If I have code such as the following:
Is there a way I can add the links attribute for compound documents?