I see there's an easy way to add links to an object via the location DSL or the links callback, but this only adds links to individual resources. Is there a way to add links to the top-level of a collection? For example, how can I do this:
{
"links": {
"self": "http://example.com/articles"
},
"data": [{
"type": "articles",
"id": "1",
"attributes": {
"title": "JSON API paints my bikeshed!"
}
}, {
"type": "articles",
"id": "2",
"attributes": {
"title": "Rails is Omakase"
}
}]
}
I see there's an easy way to add links to an object via the
locationDSL or thelinkscallback, but this only adds links to individual resources. Is there a way to add links to the top-level of a collection? For example, how can I do this:{ "links": { "self": "http://example.com/articles" }, "data": [{ "type": "articles", "id": "1", "attributes": { "title": "JSON API paints my bikeshed!" } }, { "type": "articles", "id": "2", "attributes": { "title": "Rails is Omakase" } }] }