{"action":"created","comment":{"url":"https://api.github.com/repos/WP-API/WP-API/pulls/comments/59088770","id":59088770,"diff_hunk":"@@ -517,6 +517,17 @@ public function prepare_item_for_response( $user, $request ) {\n \t\t}\n \n \t\t$context = ! empty( $request['context'] ) ? $request['context'] : 'embed';\n+\n+\t\tif ( 'edit' === $context ) {\n+\t\t\tif ( empty( $data['capabilities'] ) ) {\n+\t\t\t\t$data['capabilities'] = new stdClass();","path":"lib/endpoints/class-wp-rest-users-controller.php","position":7,"original_position":7,"commit_id":"779983e27966f1235161f015f660d25396da144b","original_commit_id":"779983e27966f1235161f015f660d25396da144b","user":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"body":"> Can you take a look to see if there's prior art?\r\n\r\nI took a look at the codebase. For the date fields, we use `null` instead of an empty string if there's no date stored. For `parent`, we use `null` if `0` is stored in the database. I think we should probably use `null` instead of an empty object.","created_at":"2016-04-08T21:02:05Z","updated_at":"2016-04-08T21:02:05Z","html_url":"https://github.com/WP-API/WP-API/pull/2429#discussion_r59088770","pull_request_url":"https://api.github.com/repos/WP-API/WP-API/pulls/2429","_links":{"self":{"href":"https://api.github.com/repos/WP-API/WP-API/pulls/comments/59088770"},"html":{"href":"https://github.com/WP-API/WP-API/pull/2429#discussion_r59088770"},"pull_request":{"href":"https://api.github.com/repos/WP-API/WP-API/pulls/2429"}}},"pull_request":{"url":"https://api.github.com/repos/WP-API/WP-API/pulls/2429","id":65726137,"html_url":"https://github.com/WP-API/WP-API/pull/2429","diff_url":"https://github.com/WP-API/WP-API/pull/2429.diff","patch_url":"https://github.com/WP-API/WP-API/pull/2429.patch","issue_url":"https://api.github.com/repos/WP-API/WP-API/issues/2429","number":2429,"state":"open","locked":false,"title":"#2426 inconsistent type for user caps","user":{"login":"BE-Webdesign","id":16389612,"avatar_url":"https://avatars.githubusercontent.com/u/16389612?v=3","gravatar_id":"","url":"https://api.github.com/users/BE-Webdesign","html_url":"https://github.com/BE-Webdesign","followers_url":"https://api.github.com/users/BE-Webdesign/followers","following_url":"https://api.github.com/users/BE-Webdesign/following{/other_user}","gists_url":"https://api.github.com/users/BE-Webdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/BE-Webdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BE-Webdesign/subscriptions","organizations_url":"https://api.github.com/users/BE-Webdesign/orgs","repos_url":"https://api.github.com/users/BE-Webdesign/repos","events_url":"https://api.github.com/users/BE-Webdesign/events{/privacy}","received_events_url":"https://api.github.com/users/BE-Webdesign/received_events","type":"User","site_admin":false},"body":"Fixes #2426, returns an empty object for users who do not have capabilities.","created_at":"2016-04-08T01:44:32Z","updated_at":"2016-04-08T21:02:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76216a35eaf1062052fc783a8e07e84343f9228d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WP-API/WP-API/pulls/2429/commits","review_comments_url":"https://api.github.com/repos/WP-API/WP-API/pulls/2429/comments","review_comment_url":"https://api.github.com/repos/WP-API/WP-API/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WP-API/WP-API/issues/2429/comments","statuses_url":"https://api.github.com/repos/WP-API/WP-API/statuses/779983e27966f1235161f015f660d25396da144b","head":{"label":"BE-Webdesign:#2426-inconsistent-type-for-user-caps","ref":"#2426-inconsistent-type-for-user-caps","sha":"779983e27966f1235161f015f660d25396da144b","user":{"login":"BE-Webdesign","id":16389612,"avatar_url":"https://avatars.githubusercontent.com/u/16389612?v=3","gravatar_id":"","url":"https://api.github.com/users/BE-Webdesign","html_url":"https://github.com/BE-Webdesign","followers_url":"https://api.github.com/users/BE-Webdesign/followers","following_url":"https://api.github.com/users/BE-Webdesign/following{/other_user}","gists_url":"https://api.github.com/users/BE-Webdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/BE-Webdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BE-Webdesign/subscriptions","organizations_url":"https://api.github.com/users/BE-Webdesign/orgs","repos_url":"https://api.github.com/users/BE-Webdesign/repos","events_url":"https://api.github.com/users/BE-Webdesign/events{/privacy}","received_events_url":"https://api.github.com/users/BE-Webdesign/received_events","type":"User","site_admin":false},"repo":{"id":51340889,"name":"WP-API","full_name":"BE-Webdesign/WP-API","owner":{"login":"BE-Webdesign","id":16389612,"avatar_url":"https://avatars.githubusercontent.com/u/16389612?v=3","gravatar_id":"","url":"https://api.github.com/users/BE-Webdesign","html_url":"https://github.com/BE-Webdesign","followers_url":"https://api.github.com/users/BE-Webdesign/followers","following_url":"https://api.github.com/users/BE-Webdesign/following{/other_user}","gists_url":"https://api.github.com/users/BE-Webdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/BE-Webdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BE-Webdesign/subscriptions","organizations_url":"https://api.github.com/users/BE-Webdesign/orgs","repos_url":"https://api.github.com/users/BE-Webdesign/repos","events_url":"https://api.github.com/users/BE-Webdesign/events{/privacy}","received_events_url":"https://api.github.com/users/BE-Webdesign/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BE-Webdesign/WP-API","description":"WP REST API - a JSON-based REST API for WordPress.","fork":true,"url":"https://api.github.com/repos/BE-Webdesign/WP-API","forks_url":"https://api.github.com/repos/BE-Webdesign/WP-API/forks","keys_url":"https://api.github.com/repos/BE-Webdesign/WP-API/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BE-Webdesign/WP-API/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BE-Webdesign/WP-API/teams","hooks_url":"https://api.github.com/repos/BE-Webdesign/WP-API/hooks","issue_events_url":"https://api.github.com/repos/BE-Webdesign/WP-API/issues/events{/number}","events_url":"https://api.github.com/repos/BE-Webdesign/WP-API/events","assignees_url":"https://api.github.com/repos/BE-Webdesign/WP-API/assignees{/user}","branches_url":"https://api.github.com/repos/BE-Webdesign/WP-API/branches{/branch}","tags_url":"https://api.github.com/repos/BE-Webdesign/WP-API/tags","blobs_url":"https://api.github.com/repos/BE-Webdesign/WP-API/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BE-Webdesign/WP-API/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BE-Webdesign/WP-API/git/refs{/sha}","trees_url":"https://api.github.com/repos/BE-Webdesign/WP-API/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BE-Webdesign/WP-API/statuses/{sha}","languages_url":"https://api.github.com/repos/BE-Webdesign/WP-API/languages","stargazers_url":"https://api.github.com/repos/BE-Webdesign/WP-API/stargazers","contributors_url":"https://api.github.com/repos/BE-Webdesign/WP-API/contributors","subscribers_url":"https://api.github.com/repos/BE-Webdesign/WP-API/subscribers","subscription_url":"https://api.github.com/repos/BE-Webdesign/WP-API/subscription","commits_url":"https://api.github.com/repos/BE-Webdesign/WP-API/commits{/sha}","git_commits_url":"https://api.github.com/repos/BE-Webdesign/WP-API/git/commits{/sha}","comments_url":"https://api.github.com/repos/BE-Webdesign/WP-API/comments{/number}","issue_comment_url":"https://api.github.com/repos/BE-Webdesign/WP-API/issues/comments{/number}","contents_url":"https://api.github.com/repos/BE-Webdesign/WP-API/contents/{+path}","compare_url":"https://api.github.com/repos/BE-Webdesign/WP-API/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BE-Webdesign/WP-API/merges","archive_url":"https://api.github.com/repos/BE-Webdesign/WP-API/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BE-Webdesign/WP-API/downloads","issues_url":"https://api.github.com/repos/BE-Webdesign/WP-API/issues{/number}","pulls_url":"https://api.github.com/repos/BE-Webdesign/WP-API/pulls{/number}","milestones_url":"https://api.github.com/repos/BE-Webdesign/WP-API/milestones{/number}","notifications_url":"https://api.github.com/repos/BE-Webdesign/WP-API/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BE-Webdesign/WP-API/labels{/name}","releases_url":"https://api.github.com/repos/BE-Webdesign/WP-API/releases{/id}","deployments_url":"https://api.github.com/repos/BE-Webdesign/WP-API/deployments","created_at":"2016-02-09T01:55:05Z","updated_at":"2016-02-09T01:55:06Z","pushed_at":"2016-04-08T17:16:59Z","git_url":"git://github.com/BE-Webdesign/WP-API.git","ssh_url":"git@github.com:BE-Webdesign/WP-API.git","clone_url":"https://github.com/BE-Webdesign/WP-API.git","svn_url":"https://github.com/BE-Webdesign/WP-API","homepage":"http://v2.wp-api.org","size":7157,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"WP-API:develop","ref":"develop","sha":"d0a392c3397960f81cf0bff0db239814c12aa228","user":{"login":"WP-API","id":5706008,"avatar_url":"https://avatars.githubusercontent.com/u/5706008?v=3","gravatar_id":"","url":"https://api.github.com/users/WP-API","html_url":"https://github.com/WP-API","followers_url":"https://api.github.com/users/WP-API/followers","following_url":"https://api.github.com/users/WP-API/following{/other_user}","gists_url":"https://api.github.com/users/WP-API/gists{/gist_id}","starred_url":"https://api.github.com/users/WP-API/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WP-API/subscriptions","organizations_url":"https://api.github.com/users/WP-API/orgs","repos_url":"https://api.github.com/users/WP-API/repos","events_url":"https://api.github.com/users/WP-API/events{/privacy}","received_events_url":"https://api.github.com/users/WP-API/received_events","type":"Organization","site_admin":false},"repo":{"id":10420996,"name":"WP-API","full_name":"WP-API/WP-API","owner":{"login":"WP-API","id":5706008,"avatar_url":"https://avatars.githubusercontent.com/u/5706008?v=3","gravatar_id":"","url":"https://api.github.com/users/WP-API","html_url":"https://github.com/WP-API","followers_url":"https://api.github.com/users/WP-API/followers","following_url":"https://api.github.com/users/WP-API/following{/other_user}","gists_url":"https://api.github.com/users/WP-API/gists{/gist_id}","starred_url":"https://api.github.com/users/WP-API/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WP-API/subscriptions","organizations_url":"https://api.github.com/users/WP-API/orgs","repos_url":"https://api.github.com/users/WP-API/repos","events_url":"https://api.github.com/users/WP-API/events{/privacy}","received_events_url":"https://api.github.com/users/WP-API/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WP-API/WP-API","description":"WP REST API - a JSON-based REST API for WordPress.","fork":false,"url":"https://api.github.com/repos/WP-API/WP-API","forks_url":"https://api.github.com/repos/WP-API/WP-API/forks","keys_url":"https://api.github.com/repos/WP-API/WP-API/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WP-API/WP-API/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WP-API/WP-API/teams","hooks_url":"https://api.github.com/repos/WP-API/WP-API/hooks","issue_events_url":"https://api.github.com/repos/WP-API/WP-API/issues/events{/number}","events_url":"https://api.github.com/repos/WP-API/WP-API/events","assignees_url":"https://api.github.com/repos/WP-API/WP-API/assignees{/user}","branches_url":"https://api.github.com/repos/WP-API/WP-API/branches{/branch}","tags_url":"https://api.github.com/repos/WP-API/WP-API/tags","blobs_url":"https://api.github.com/repos/WP-API/WP-API/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WP-API/WP-API/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WP-API/WP-API/git/refs{/sha}","trees_url":"https://api.github.com/repos/WP-API/WP-API/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WP-API/WP-API/statuses/{sha}","languages_url":"https://api.github.com/repos/WP-API/WP-API/languages","stargazers_url":"https://api.github.com/repos/WP-API/WP-API/stargazers","contributors_url":"https://api.github.com/repos/WP-API/WP-API/contributors","subscribers_url":"https://api.github.com/repos/WP-API/WP-API/subscribers","subscription_url":"https://api.github.com/repos/WP-API/WP-API/subscription","commits_url":"https://api.github.com/repos/WP-API/WP-API/commits{/sha}","git_commits_url":"https://api.github.com/repos/WP-API/WP-API/git/commits{/sha}","comments_url":"https://api.github.com/repos/WP-API/WP-API/comments{/number}","issue_comment_url":"https://api.github.com/repos/WP-API/WP-API/issues/comments{/number}","contents_url":"https://api.github.com/repos/WP-API/WP-API/contents/{+path}","compare_url":"https://api.github.com/repos/WP-API/WP-API/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WP-API/WP-API/merges","archive_url":"https://api.github.com/repos/WP-API/WP-API/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WP-API/WP-API/downloads","issues_url":"https://api.github.com/repos/WP-API/WP-API/issues{/number}","pulls_url":"https://api.github.com/repos/WP-API/WP-API/pulls{/number}","milestones_url":"https://api.github.com/repos/WP-API/WP-API/milestones{/number}","notifications_url":"https://api.github.com/repos/WP-API/WP-API/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WP-API/WP-API/labels{/name}","releases_url":"https://api.github.com/repos/WP-API/WP-API/releases{/id}","deployments_url":"https://api.github.com/repos/WP-API/WP-API/deployments","created_at":"2013-06-01T10:52:43Z","updated_at":"2016-04-08T19:12:59Z","pushed_at":"2016-04-08T17:17:00Z","git_url":"git://github.com/WP-API/WP-API.git","ssh_url":"git@github.com:WP-API/WP-API.git","clone_url":"https://github.com/WP-API/WP-API.git","svn_url":"https://github.com/WP-API/WP-API","homepage":"http://v2.wp-api.org","size":8610,"stargazers_count":3173,"watchers_count":3173,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":585,"mirror_url":null,"open_issues_count":94,"forks":585,"open_issues":94,"watchers":3173,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/WP-API/WP-API/pulls/2429"},"html":{"href":"https://github.com/WP-API/WP-API/pull/2429"},"issue":{"href":"https://api.github.com/repos/WP-API/WP-API/issues/2429"},"comments":{"href":"https://api.github.com/repos/WP-API/WP-API/issues/2429/comments"},"review_comments":{"href":"https://api.github.com/repos/WP-API/WP-API/pulls/2429/comments"},"review_comment":{"href":"https://api.github.com/repos/WP-API/WP-API/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WP-API/WP-API/pulls/2429/commits"},"statuses":{"href":"https://api.github.com/repos/WP-API/WP-API/statuses/779983e27966f1235161f015f660d25396da144b"}}}}