Skip to content

Links object must be a member of Relationships object #1422

Description

@d3crypt3d

I discovered that links object currently is not a member of relationships object.
Here is an example of resource object that I got:

{
  "data": [{
    "id":"980191848",
    "type":"projects",
    "attributes": {
      "name":"optio",
      "created_at":"2016-01-10T17:21:54.266Z",
      "updated_at":"2016-01-10T17:21:54.266Z"
      }, "relationships": {
           "tasks": { 
             "data": [{ 
               "id": "980191660", "type": "tasks"
             }]
         }
      }, "links": {
           "self":"//foo",
           "related":"//bar"
         }
      }
  ]}
}

In other words link object is a neighbour of the relationships one. However, according to JSON API specification, relationships should had included links inside the tasks container:

  "relationships": {
     "tasks": {
       "links": {
         "self":"//foo",
         "related":"//bar"
       }, "data": [{ 
             "id": "980191660", "type": "tasks"
          }]
    }
  }

And it doesn't depend on how the links method is defined:

link :self, '//foo'
# or
def link
  api_path(object)
end

How does the link object could be placed in a proper container?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions