{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/publishing-api/issues/126","labels_url":"https://api.github.com/repos/alphagov/publishing-api/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/publishing-api/issues/126/comments","events_url":"https://api.github.com/repos/alphagov/publishing-api/issues/126/events","html_url":"https://github.com/alphagov/publishing-api/pull/126","id":115509578,"number":126,"title":"Implement the \"publisher-bulk-get\" endpoint","user":{"login":"tijmenb","id":233676,"avatar_url":"https://avatars.githubusercontent.com/u/233676?v=3","gravatar_id":"","url":"https://api.github.com/users/tijmenb","html_url":"https://github.com/tijmenb","followers_url":"https://api.github.com/users/tijmenb/followers","following_url":"https://api.github.com/users/tijmenb/following{/other_user}","gists_url":"https://api.github.com/users/tijmenb/gists{/gist_id}","starred_url":"https://api.github.com/users/tijmenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tijmenb/subscriptions","organizations_url":"https://api.github.com/users/tijmenb/orgs","repos_url":"https://api.github.com/users/tijmenb/repos","events_url":"https://api.github.com/users/tijmenb/events{/privacy}","received_events_url":"https://api.github.com/users/tijmenb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-06T13:58:14Z","updated_at":"2015-11-12T12:21:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alphagov/publishing-api/pulls/126","html_url":"https://github.com/alphagov/publishing-api/pull/126","diff_url":"https://github.com/alphagov/publishing-api/pull/126.diff","patch_url":"https://github.com/alphagov/publishing-api/pull/126.patch"},"body":"This commit adds an endpoint to fetch all content-items for a given format. It will be used to populate the select-boxes in the tagging interfaces.\r\n\r\nFor example:\r\n\r\n```\r\n/v2/content?format=topic&fields=base_path,title\r\n```\r\n\r\nwill return:\r\n\r\n```json\r\n[\r\n  {\r\n    \"base_path\": \"/browse/benefits/entitlement\",\r\n    \"title\": \"Benefits entitlement\"\r\n  }\r\n]\r\n```\r\n\r\nThis endpoint is described in https://gov-uk.atlassian.net/wiki/display/FS/RFC+31%3A+Requirements+for+tagging+architecture.\r\n\r\n> Example: GET http://publishing-api/bulk format=topic&fields=title,content_id,base_path,draft,links.parent.title\r\n> Get information about all content items of a particular format, including draft items.\r\n> Only a limited set of fields need to be returned, but these may include:\r\n> - fields from the top-level of the content item\r\n> - whether the item is in draft state or not\r\n> - fields from within the details hash\r\n> - fields from within the expanded links hash\r\n> The endpoint may also need to support pagination / filtering for efficiency.\r\n\r\nNot all features described here have been implemented, because we might not need those yet/at all.\r\n\r\nThings of note:\r\n\r\n- I've chosen `?content_format=` over `?format=` to avoid collision with Rails' `params[:format]` (which is `:json` in this case).\r\n- There's currently no pagination, because the use case requires *all* documents of a particular format.\r\n\r\nOpen questions:\r\n\r\n- [x] Would using a more specific endpoint (`/v2/content-by-format`) be better?\r\n- [x] Our usecase requires draft items to be returned. This might not be obvious from the url. Should this be a parameter, or YAGNI?\r\n- [x] I'm allowing users to request any valid column name from the table. Do we have \"secrets\" there that we don't want to expose?\r\n- [x] Return placeholder_format documents"},"comment":{"url":"https://api.github.com/repos/alphagov/publishing-api/issues/comments/156090342","html_url":"https://github.com/alphagov/publishing-api/pull/126#issuecomment-156090342","issue_url":"https://api.github.com/repos/alphagov/publishing-api/issues/126","id":156090342,"user":{"login":"tijmenb","id":233676,"avatar_url":"https://avatars.githubusercontent.com/u/233676?v=3","gravatar_id":"","url":"https://api.github.com/users/tijmenb","html_url":"https://github.com/tijmenb","followers_url":"https://api.github.com/users/tijmenb/followers","following_url":"https://api.github.com/users/tijmenb/following{/other_user}","gists_url":"https://api.github.com/users/tijmenb/gists{/gist_id}","starred_url":"https://api.github.com/users/tijmenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tijmenb/subscriptions","organizations_url":"https://api.github.com/users/tijmenb/orgs","repos_url":"https://api.github.com/users/tijmenb/repos","events_url":"https://api.github.com/users/tijmenb/events{/privacy}","received_events_url":"https://api.github.com/users/tijmenb/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T12:21:38Z","updated_at":"2015-11-12T12:21:38Z","body":"@elliotcm ready for review again."}}