{"action":"closed","issue":{"url":"https://api.github.com/repos/json-api/json-api/issues/482","labels_url":"https://api.github.com/repos/json-api/json-api/issues/482/labels{/name}","comments_url":"https://api.github.com/repos/json-api/json-api/issues/482/comments","events_url":"https://api.github.com/repos/json-api/json-api/issues/482/events","html_url":"https://github.com/json-api/json-api/issues/482","id":62109797,"number":482,"title":"Unify formats for representing relationships","user":{"login":"ethanresnick","id":471894,"avatar_url":"https://avatars.githubusercontent.com/u/471894?v=3","gravatar_id":"","url":"https://api.github.com/users/ethanresnick","html_url":"https://github.com/ethanresnick","followers_url":"https://api.github.com/users/ethanresnick/followers","following_url":"https://api.github.com/users/ethanresnick/following{/other_user}","gists_url":"https://api.github.com/users/ethanresnick/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanresnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanresnick/subscriptions","organizations_url":"https://api.github.com/users/ethanresnick/orgs","repos_url":"https://api.github.com/users/ethanresnick/repos","events_url":"https://api.github.com/users/ethanresnick/events{/privacy}","received_events_url":"https://api.github.com/users/ethanresnick/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-03-16T15:09:21Z","updated_at":"2015-03-26T14:26:02Z","closed_at":"2015-03-26T14:26:02Z","body":"Right now, we have two formats for representing a relationship.\r\n\r\nWhen the relationship is being displayed in a response, it gets the full link-object representation:\r\n\r\n```\r\n\"author\": {\r\n  \"related\": \"\", \r\n  \"self\": \"\",\r\n  \"linkage\": \"\"\r\n  //...\r\n}\r\n```\r\n\r\nBut when the relationship is being sent by the client to the server, only the contents of the `linkage` key are sent. So the format becomes: ```\"author\": { \"type\": \"people\", \"id\": \"3\"}```.\r\n\r\nIt makes sense that creating/updating/deleting relationships is only doable through linkage, but do we really want the two separate formats? \r\n\r\n_Almost everywhere else in the spec we've gradually switched from preferring conciseness to preferring consistency. Why not do that here too?_\r\n\r\nIf we did that, when clients sent a relationship, they'd specify:\r\n\r\n```\r\n\"author\": {\r\n  \"linkage\":  { \"type\": \"people\", \"id\": \"3\"}\r\n}\r\n```\r\n\r\nAnd the spec would simply say that these client-provided link objects MUST contain a `linkage` key."}}