Closed
Description
Considering this data
{
id: 'u999',
name: 'Awesome Project',
description: 'This is an awesome project',
format: {
id: 'u1',
inputFormats: [ 'u45', 'u46' ],
outputFormats: [ 'u47', 'u48' ],
}
}
with this serializer
serializer.register("projects", {
whitelist: ["name", "description"],
relationships: {
format: {
type: 'format',
}
},
});
serializer.register("format", {
relationships: {
inputFormats: {
type: 'inputFormats',
},
outputFormats: {
type: 'outputFormats',
}
}
});
After serializing the data, it will not serialize the [ 'u45', 'u46' ]
and [ 'u47', 'u48' ]
and include the results in the included
, unless I have some attributes in the format
serializer and provide that attributes in the format
in the data
Another thing is I can't have an empty list of attributes (whitelist
). AFAIK JSON API doesn't say we have to have attributes in the resource
Metadata
Metadata
Assignees
Labels
No labels