{"action":"created","issue":{"url":"https://api.github.com/repos/jekyll/jekyll-admin/issues/211","repository_url":"https://api.github.com/repos/jekyll/jekyll-admin","labels_url":"https://api.github.com/repos/jekyll/jekyll-admin/issues/211/labels{/name}","comments_url":"https://api.github.com/repos/jekyll/jekyll-admin/issues/211/comments","events_url":"https://api.github.com/repos/jekyll/jekyll-admin/issues/211/events","html_url":"https://github.com/jekyll/jekyll-admin/pull/211","id":174294594,"number":211,"title":"Expose documents on collection index","user":{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true},"labels":[],"state":"open","locked":false,"assignee":{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true},"assignees":[{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true}],"milestone":null,"comments":0,"created_at":"2016-08-31T14:52:10Z","updated_at":"2016-08-31T15:21:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jekyll/jekyll-admin/pulls/211","html_url":"https://github.com/jekyll/jekyll-admin/pull/211","diff_url":"https://github.com/jekyll/jekyll-admin/pull/211.diff","patch_url":"https://github.com/jekyll/jekyll-admin/pull/211.patch"},"body":"This PR deprecates the `collections/collection/documents/` endpoint, and creates a new `documents` key on for the collections endpoint.\r\n\r\nThe idea being, because individual documents are `collections/collection/path`, the `collections/collection/documents/` endpoint breaks RESTful semantics.\r\n\r\nHere's what it'd look like in practice:\r\n\r\nGET `_api/collections`\r\n\r\n```json\r\n[\r\n   {\r\n      \"label\":\"posts\",\r\n      \"files\":[\r\n\r\n      ],\r\n      \"directory\":\"/Users/benbalter/github/jekyll-admin/spec/fixtures/site/_posts\",\r\n      \"relative_directory\":\"_posts\",\r\n      \"permalink\":\"/:categories/:year/:month/:day/:title:output_ext\",\r\n      \"http_url\":null,\r\n      \"api_url\":\"http://localhost:4000/_api/collections/posts\"\r\n   },\r\n   {\r\n      \"label\":\"puppies\",\r\n      \"files\":[\r\n\r\n      ],\r\n      \"directory\":\"/Users/benbalter/github/jekyll-admin/spec/fixtures/site/_puppies\",\r\n      \"relative_directory\":\"_puppies\",\r\n      \"foo\":\"bar\",\r\n      \"http_url\":null,\r\n      \"api_url\":\"http://localhost:4000/_api/collections/puppies\"\r\n   }\r\n]\r\n```\r\n\r\nGET `_api/collections/posts`\r\n\r\n```json\r\n{\r\n   \"label\":\"posts\",\r\n   \"files\":[\r\n\r\n   ],\r\n   \"directory\":\"/Users/benbalter/github/jekyll-admin/spec/fixtures/site/_posts\",\r\n   \"relative_directory\":\"_posts\",\r\n   \"permalink\":\"/:categories/:year/:month/:day/:title:output_ext\",\r\n   \"http_url\":null,\r\n   \"api_url\":\"http://localhost:4000/_api/collections/posts\",\r\n   \"documents\":[\r\n      {\r\n         \"path\":\"_posts/2016-01-01-test.md\",\r\n         \"url\":\"/2016/01/01/test.html\",\r\n         \"id\":\"/2016/01/01/test\",\r\n         \"relative_path\":\"_posts/2016-01-01-test.md\",\r\n         \"collection\":\"posts\",\r\n         \"draft\":false,\r\n         \"categories\":[\r\n\r\n         ],\r\n         \"some_front_matter\":\"default\",\r\n         \"foo\":\"bar\",\r\n         \"date\":\"2016-01-01 00:00:00 -0500\",\r\n         \"title\":\"Test\",\r\n         \"slug\":\"test\",\r\n         \"ext\":\".md\",\r\n         \"tags\":[\r\n\r\n         ],\r\n         \"http_url\":\"http://localhost:4000/2016/01/01/test.html\",\r\n         \"api_url\":\"http://localhost:4000/_api/collections/posts/2016-01-01-test.md\"\r\n      },\r\n      {\r\n         \"path\":\"_posts/2016-02-01-test.md\",\r\n         \"url\":\"/2016/02/01/test.html\",\r\n         \"id\":\"/2016/02/01/test\",\r\n         \"relative_path\":\"_posts/2016-02-01-test.md\",\r\n         \"collection\":\"posts\",\r\n         \"draft\":false,\r\n         \"categories\":[\r\n\r\n         ],\r\n         \"some_front_matter\":\"default\",\r\n         \"foo\":\"bar\",\r\n         \"date\":\"2016-02-01 00:00:00 -0500\",\r\n         \"title\":\"Test\",\r\n         \"slug\":\"test\",\r\n         \"ext\":\".md\",\r\n         \"tags\":[\r\n\r\n         ],\r\n         \"http_url\":\"http://localhost:4000/2016/02/01/test.html\",\r\n         \"api_url\":\"http://localhost:4000/_api/collections/posts/2016-02-01-test.md\"\r\n      },\r\n      {\r\n         \"path\":\"_posts/2016-03-01-test.md\",\r\n         \"url\":\"/2016/03/01/test.html\",\r\n         \"id\":\"/2016/03/01/test\",\r\n         \"relative_path\":\"_posts/2016-03-01-test.md\",\r\n         \"collection\":\"posts\",\r\n         \"draft\":false,\r\n         \"categories\":[\r\n\r\n         ],\r\n         \"some_front_matter\":\"default\",\r\n         \"foo\":\"bar\",\r\n         \"date\":\"2016-03-01 00:00:00 -0500\",\r\n         \"title\":\"Test\",\r\n         \"slug\":\"test\",\r\n         \"ext\":\".md\",\r\n         \"tags\":[\r\n\r\n         ],\r\n         \"http_url\":\"http://localhost:4000/2016/03/01/test.html\",\r\n         \"api_url\":\"http://localhost:4000/_api/collections/posts/2016-03-01-test.md\"\r\n      }\r\n   ]\r\n}\r\n```\r\n\r\nPending feedback, my suggestion would be to merge this non-breaking PR, and then update the front end to use the new endpoint in a subsequent pass.\r\n\r\nFixes https://github.com/jekyll/jekyll-admin/issues/172."},"comment":{"url":"https://api.github.com/repos/jekyll/jekyll-admin/issues/comments/243799429","html_url":"https://github.com/jekyll/jekyll-admin/pull/211#issuecomment-243799429","issue_url":"https://api.github.com/repos/jekyll/jekyll-admin/issues/211","id":243799429,"user":{"login":"mertkahyaoglu","id":7414026,"avatar_url":"https://avatars.githubusercontent.com/u/7414026?v=3","gravatar_id":"","url":"https://api.github.com/users/mertkahyaoglu","html_url":"https://github.com/mertkahyaoglu","followers_url":"https://api.github.com/users/mertkahyaoglu/followers","following_url":"https://api.github.com/users/mertkahyaoglu/following{/other_user}","gists_url":"https://api.github.com/users/mertkahyaoglu/gists{/gist_id}","starred_url":"https://api.github.com/users/mertkahyaoglu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mertkahyaoglu/subscriptions","organizations_url":"https://api.github.com/users/mertkahyaoglu/orgs","repos_url":"https://api.github.com/users/mertkahyaoglu/repos","events_url":"https://api.github.com/users/mertkahyaoglu/events{/privacy}","received_events_url":"https://api.github.com/users/mertkahyaoglu/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T15:21:28Z","updated_at":"2016-08-31T15:21:28Z","body":"LGTM 👍 . Front end is not even using `_api/collections/COLLECTION_NAME` endpoint right now. This way, we will make use of it and follow RESTful semantics."}}
{"actor":{"display_login":"mertkahyaoglu"}}