{"action":"closed","number":595,"pull_request":{"url":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/595","id":87472219,"html_url":"https://github.com/alphagov/gds-api-adapters/pull/595","diff_url":"https://github.com/alphagov/gds-api-adapters/pull/595.diff","patch_url":"https://github.com/alphagov/gds-api-adapters/pull/595.patch","issue_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/595","number":595,"state":"closed","locked":false,"title":"Only return expected number of items from publishing_api_has_content","user":{"login":"carvil","id":416701,"avatar_url":"https://avatars.githubusercontent.com/u/416701?v=3","gravatar_id":"","url":"https://api.github.com/users/carvil","html_url":"https://github.com/carvil","followers_url":"https://api.github.com/users/carvil/followers","following_url":"https://api.github.com/users/carvil/following{/other_user}","gists_url":"https://api.github.com/users/carvil/gists{/gist_id}","starred_url":"https://api.github.com/users/carvil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carvil/subscriptions","organizations_url":"https://api.github.com/users/carvil/orgs","repos_url":"https://api.github.com/users/carvil/repos","events_url":"https://api.github.com/users/carvil/events{/privacy}","received_events_url":"https://api.github.com/users/carvil/received_events","type":"User","site_admin":false},"body":"This change makes sure that we return the expected results based on the\r\npagination information.\r\n\r\nEven though we need to stub the API call with a number of items, this endpoint\r\nshould only return the ones belonging to the page requested (taking into account\r\nthe number of items per page).\r\n\r\nAs an example, for a call like:\r\n\r\n```\r\npublishing_api_has_content(\r\n  [\r\n    { \"content_id\" => 'content_id_1' },\r\n    { \"content_id\" => 'content_id_2' },\r\n    { \"content_id\" => 'content_id_3' },\r\n  ],\r\n  {\r\n    page: 2,\r\n    per_page: 2\r\n  }\r\n)\r\n```\r\n\r\nWhere the user is requesting the 2nd page with 2 items per page, the API call\r\nshould only return the last entry in that array ('content_id_3'), which is the\r\nonly items on the 2nd page.\r\n\r\nFor out-of-bound queries, we should return an empty array.","created_at":"2016-09-30T10:46:14Z","updated_at":"2016-09-30T11:38:28Z","closed_at":"2016-09-30T11:38:28Z","merged_at":"2016-09-30T11:38:28Z","merge_commit_sha":"84742b9247011f1175cb8f5367d898afb6805ef3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/595/commits","review_comments_url":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/595/comments","review_comment_url":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/595/comments","statuses_url":"https://api.github.com/repos/alphagov/gds-api-adapters/statuses/0c8d0fa7f80d54d39537d9f44f044563c3bdd73b","head":{"label":"alphagov:return-expected-number-of-items","ref":"return-expected-number-of-items","sha":"0c8d0fa7f80d54d39537d9f44f044563c3bdd73b","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":2898846,"name":"gds-api-adapters","full_name":"alphagov/gds-api-adapters","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/gds-api-adapters","description":"A set of API adapters to work with the GOV.UK APIs","fork":false,"url":"https://api.github.com/repos/alphagov/gds-api-adapters","forks_url":"https://api.github.com/repos/alphagov/gds-api-adapters/forks","keys_url":"https://api.github.com/repos/alphagov/gds-api-adapters/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/gds-api-adapters/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/gds-api-adapters/teams","hooks_url":"https://api.github.com/repos/alphagov/gds-api-adapters/hooks","issue_events_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/gds-api-adapters/events","assignees_url":"https://api.github.com/repos/alphagov/gds-api-adapters/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/gds-api-adapters/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/gds-api-adapters/tags","blobs_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/gds-api-adapters/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/gds-api-adapters/languages","stargazers_url":"https://api.github.com/repos/alphagov/gds-api-adapters/stargazers","contributors_url":"https://api.github.com/repos/alphagov/gds-api-adapters/contributors","subscribers_url":"https://api.github.com/repos/alphagov/gds-api-adapters/subscribers","subscription_url":"https://api.github.com/repos/alphagov/gds-api-adapters/subscription","commits_url":"https://api.github.com/repos/alphagov/gds-api-adapters/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/gds-api-adapters/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/gds-api-adapters/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/gds-api-adapters/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/gds-api-adapters/merges","archive_url":"https://api.github.com/repos/alphagov/gds-api-adapters/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/gds-api-adapters/downloads","issues_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/gds-api-adapters/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/gds-api-adapters/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/gds-api-adapters/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/gds-api-adapters/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/gds-api-adapters/deployments","created_at":"2011-12-02T14:13:57Z","updated_at":"2016-09-06T14:25:38Z","pushed_at":"2016-09-30T11:38:28Z","git_url":"git://github.com/alphagov/gds-api-adapters.git","ssh_url":"git@github.com:alphagov/gds-api-adapters.git","clone_url":"https://github.com/alphagov/gds-api-adapters.git","svn_url":"https://github.com/alphagov/gds-api-adapters","homepage":"http://www.rubydoc.info/github/alphagov/gds-api-adapters","size":1572,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"73e0caacd2857028c6354727a56c038696f0d3e8","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":2898846,"name":"gds-api-adapters","full_name":"alphagov/gds-api-adapters","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/gds-api-adapters","description":"A set of API adapters to work with the GOV.UK APIs","fork":false,"url":"https://api.github.com/repos/alphagov/gds-api-adapters","forks_url":"https://api.github.com/repos/alphagov/gds-api-adapters/forks","keys_url":"https://api.github.com/repos/alphagov/gds-api-adapters/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/gds-api-adapters/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/gds-api-adapters/teams","hooks_url":"https://api.github.com/repos/alphagov/gds-api-adapters/hooks","issue_events_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/gds-api-adapters/events","assignees_url":"https://api.github.com/repos/alphagov/gds-api-adapters/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/gds-api-adapters/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/gds-api-adapters/tags","blobs_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/gds-api-adapters/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/gds-api-adapters/languages","stargazers_url":"https://api.github.com/repos/alphagov/gds-api-adapters/stargazers","contributors_url":"https://api.github.com/repos/alphagov/gds-api-adapters/contributors","subscribers_url":"https://api.github.com/repos/alphagov/gds-api-adapters/subscribers","subscription_url":"https://api.github.com/repos/alphagov/gds-api-adapters/subscription","commits_url":"https://api.github.com/repos/alphagov/gds-api-adapters/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/gds-api-adapters/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/gds-api-adapters/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/gds-api-adapters/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/gds-api-adapters/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/gds-api-adapters/merges","archive_url":"https://api.github.com/repos/alphagov/gds-api-adapters/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/gds-api-adapters/downloads","issues_url":"https://api.github.com/repos/alphagov/gds-api-adapters/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/gds-api-adapters/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/gds-api-adapters/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/gds-api-adapters/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/gds-api-adapters/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/gds-api-adapters/deployments","created_at":"2011-12-02T14:13:57Z","updated_at":"2016-09-06T14:25:38Z","pushed_at":"2016-09-30T11:38:28Z","git_url":"git://github.com/alphagov/gds-api-adapters.git","ssh_url":"git@github.com:alphagov/gds-api-adapters.git","clone_url":"https://github.com/alphagov/gds-api-adapters.git","svn_url":"https://github.com/alphagov/gds-api-adapters","homepage":"http://www.rubydoc.info/github/alphagov/gds-api-adapters","size":1572,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/595"},"html":{"href":"https://github.com/alphagov/gds-api-adapters/pull/595"},"issue":{"href":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/595"},"comments":{"href":"https://api.github.com/repos/alphagov/gds-api-adapters/issues/595/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/595/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/gds-api-adapters/pulls/595/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/gds-api-adapters/statuses/0c8d0fa7f80d54d39537d9f44f044563c3bdd73b"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"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},"comments":0,"review_comments":0,"commits":1,"additions":38,"deletions":5,"changed_files":2}}
{"actor":{"display_login":"tijmenb"}}