Skip to content

Links at top level of resource collection #222

@lleger

Description

@lleger

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"
    }
  }]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions