{"action":"created","issue":{"url":"https://api.github.com/repos/json-api/json-api/issues/170","labels_url":"https://api.github.com/repos/json-api/json-api/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/json-api/json-api/issues/170/comments","events_url":"https://api.github.com/repos/json-api/json-api/issues/170/events","html_url":"https://github.com/json-api/json-api/issues/170","id":23682962,"number":170,"title":"Clarity on n-nested document links in compound documents","user":{"login":"lettertwo","id":210630,"avatar_url":"https://avatars.githubusercontent.com/u/210630?v=3","gravatar_id":"","url":"https://api.github.com/users/lettertwo","html_url":"https://github.com/lettertwo","followers_url":"https://api.github.com/users/lettertwo/followers","following_url":"https://api.github.com/users/lettertwo/following{/other_user}","gists_url":"https://api.github.com/users/lettertwo/gists{/gist_id}","starred_url":"https://api.github.com/users/lettertwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lettertwo/subscriptions","organizations_url":"https://api.github.com/users/lettertwo/orgs","repos_url":"https://api.github.com/users/lettertwo/repos","events_url":"https://api.github.com/users/lettertwo/events{/privacy}","received_events_url":"https://api.github.com/users/lettertwo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/json-api/json-api/milestones/1","html_url":"https://github.com/json-api/json-api/milestones/1.0","labels_url":"https://api.github.com/repos/json-api/json-api/milestones/1/labels","id":597996,"number":1,"title":"1.0","description":"The first stable release of JSON API.","creator":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":11,"state":"open","created_at":"2014-03-14T17:28:46Z","updated_at":"2015-03-05T00:13:32Z","due_on":"2014-03-22T07:00:00Z","closed_at":null},"comments":4,"created_at":"2013-12-03T23:29:36Z","updated_at":"2015-03-05T00:14:29Z","closed_at":null,"body":"Given the following (abbreviated) example of a compound document taken from the spec:\r\n\r\n```json\r\n{\r\n  \"links\": {\r\n    \"posts.author\": {\r\n      \"href\": \"http://example.com/people/{posts.author}\",\r\n      \"type\": \"people\"\r\n    },\r\n    \"posts.comments\": {\r\n      \"href\": \"http://example.com/comments/{posts.comments}\",\r\n      \"type\": \"comments\"\r\n    }\r\n  },\r\n  \"posts\": [{\r\n    \"id\": \"1\",\r\n    \"title\": \"Rails is Omakase\",\r\n    \"links\": {\r\n      \"author\": \"9\",\r\n      \"comments\": [ \"1\" ]\r\n    }\r\n  }],\r\n  \"linked\": {\r\n    \"people\": [{\r\n      \"id\": \"9\",\r\n      \"name\": \"@d2h\"\r\n    }],\r\n    \"comments\": [{\r\n      \"id\": \"1\",\r\n      \"body\": \"Mmmmmakase\"\r\n    }]\r\n  }\r\n}\r\n```\r\n\r\nIt is clear how the links between the `linked` documents and the primary `posts` document are determined.\r\n\r\nHowever, the spec doesn't appear to address what a compound document might look like when relationships are nested further (i.e., ``linked`` documents themselves have ``links``).\r\n\r\nFor example (the difference between this example and the one above is that the included comment document also has a link to a comment 'author'):\r\n\r\n```json\r\n{\r\n  \"links\": {\r\n    \"posts.author\": {\r\n      \"href\": \"http://example.com/people/{posts.author}\",\r\n      \"type\": \"people\"\r\n    },\r\n    \"posts.comments\": {\r\n      \"href\": \"http://example.com/comments/{posts.comments}\",\r\n      \"type\": \"comments\"\r\n    },\r\n    \"comments.author\": {\r\n      \"href\": \"http://example.com/people/{comments.author}\",\r\n      \"type\": \"people\"\r\n    }\r\n  },\r\n  \"posts\": [{\r\n    \"id\": \"1\",\r\n    \"title\": \"Rails is Omakase\",\r\n    \"links\": {\r\n      \"author\": \"9\",\r\n      \"comments\": [ \"1\" ]\r\n    }\r\n  }],\r\n  \"linked\": {\r\n    \"people\": [{\r\n      \"id\": \"9\",\r\n      \"name\": \"@d2h\"\r\n    }],\r\n    \"comments\": [{\r\n      \"id\": \"1\",\r\n      \"body\": \"Mmmmmakase\",\r\n      \"links\": {\r\n        \"author\": \"9\"\r\n      }\r\n    }]\r\n  }\r\n}\r\n```\r\nIs this is an accurate understanding of the spec? Can non-primary (`linked`) documents have their own mappings in the top-level `links`?  Are those mappings always relative to the primary document (i.e. `posts.comments.author`), or are they relative to the document resource (i.e. `comments.author`, as above)?"},"comment":{"url":"https://api.github.com/repos/json-api/json-api/issues/comments/77279872","html_url":"https://github.com/json-api/json-api/issues/170#issuecomment-77279872","issue_url":"https://api.github.com/repos/json-api/json-api/issues/170","id":77279872,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T00:14:28Z","updated_at":"2015-03-05T00:14:28Z","body":"This very old issue is basically not relevant today, I believe. The spec has changed in the meantime. Thanks!"}}