-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Description
The relationshipLinks option only allow related where the 1.0 specification allows both self and related.
possible section of code related to the issue
https://github.com/SeyZ/jsonapi-serializer/blob/master/lib/serializer-utils.js#L162
1.0 specification section
https://jsonapi.org/format/#document-resource-object-relationships
I cannot do the following and have "self" links:
let people = [
{
id: 10,
fname: 'aaa',
lname: 'bbb',
title: 'king',
subPerson: {
id: 12,
fname: 'ccc',
lname: 'ddd',
title: 'knight'
}
},
{
id: 11,
fname: 'eee',
lname: 'fff',
title: 'queen',
subPerson: {
id: 13,
fname: 'ggg',
lname: 'hhh',
title: 'jester'
}
}
];
let response = new JSONAPI('people', {
meta: { count: 2 },
attributes: ['fname', 'lname', 'title', 'subPerson'],
subPerson: {
ref: 'id',
//included: false,
attributes: ['fname', 'lname', 'title'],
relationshipLinks: {
self: function(record, current, parent) {
return '/api/jsonapi/people/' + current.id;
}
}
}
}).serialize(people);Metadata
Metadata
Assignees
Labels
No labels