{"action":"created","comment":{"url":"https://api.github.com/repos/koke/WordPressComKit/pulls/comments/55520958","id":55520958,"diff_hunk":"@@ -0,0 +1,46 @@\n+import Foundation\n+import Alamofire\n+\n+public class MeService {\n+    public init() {}\n+    \n+    public func fetchMe(completion: (Me?, NSError?) -> Void) {\n+        Alamofire\n+            .request(RequestRouter.Me())\n+            .validate()\n+            .responseJSON { response in\n+                guard response.result.isSuccess else {\n+                    completion(nil, response.result.error)\n+                    return\n+                }\n+                \n+                let json = response.result.value as? [String: AnyObject]\n+                let me = Me()\n+                me.ID = json![\"ID\"] as! Int","path":"WordPressComKit/MeService.swift","position":19,"original_position":19,"commit_id":"c7fcc1a0c8c9241b411186a3f9ad8409b22486f3","original_commit_id":"c7fcc1a0c8c9241b411186a3f9ad8409b22486f3","user":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"body":"I'd very much rather use `guard` than `!` for JSON parsing. In general, but specially in a library that others could use. You want to fail early if the API returns something unexpected, but you don't want to crash. ","created_at":"2016-03-09T14:00:57Z","updated_at":"2016-03-09T14:00:57Z","html_url":"https://github.com/koke/WordPressComKit/pull/1#discussion_r55520958","pull_request_url":"https://api.github.com/repos/koke/WordPressComKit/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/koke/WordPressComKit/pulls/comments/55520958"},"html":{"href":"https://github.com/koke/WordPressComKit/pull/1#discussion_r55520958"},"pull_request":{"href":"https://api.github.com/repos/koke/WordPressComKit/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/koke/WordPressComKit/pulls/1","id":62219184,"html_url":"https://github.com/koke/WordPressComKit/pull/1","diff_url":"https://github.com/koke/WordPressComKit/pull/1.diff","patch_url":"https://github.com/koke/WordPressComKit/pull/1.patch","issue_url":"https://api.github.com/repos/koke/WordPressComKit/issues/1","number":1,"state":"open","locked":false,"title":"Initial review","user":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"body":"I've taken a snapshot of https://github.com/Automattic/WordPressComKit and rebased it into an empty repo so we can use GitHub to review the code.\r\n\r\nCc: @astralbodies @jleandroperez ","created_at":"2016-03-09T12:08:19Z","updated_at":"2016-03-09T14:00:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"588274de075288cec189e69f0ba6c6fae50b7942","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/koke/WordPressComKit/pulls/1/commits","review_comments_url":"https://api.github.com/repos/koke/WordPressComKit/pulls/1/comments","review_comment_url":"https://api.github.com/repos/koke/WordPressComKit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/koke/WordPressComKit/issues/1/comments","statuses_url":"https://api.github.com/repos/koke/WordPressComKit/statuses/c7fcc1a0c8c9241b411186a3f9ad8409b22486f3","head":{"label":"koke:initial-review","ref":"initial-review","sha":"c7fcc1a0c8c9241b411186a3f9ad8409b22486f3","user":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"repo":{"id":53494158,"name":"WordPressComKit","full_name":"koke/WordPressComKit","owner":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/koke/WordPressComKit","description":"Don't look here, go here instead:","fork":false,"url":"https://api.github.com/repos/koke/WordPressComKit","forks_url":"https://api.github.com/repos/koke/WordPressComKit/forks","keys_url":"https://api.github.com/repos/koke/WordPressComKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koke/WordPressComKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koke/WordPressComKit/teams","hooks_url":"https://api.github.com/repos/koke/WordPressComKit/hooks","issue_events_url":"https://api.github.com/repos/koke/WordPressComKit/issues/events{/number}","events_url":"https://api.github.com/repos/koke/WordPressComKit/events","assignees_url":"https://api.github.com/repos/koke/WordPressComKit/assignees{/user}","branches_url":"https://api.github.com/repos/koke/WordPressComKit/branches{/branch}","tags_url":"https://api.github.com/repos/koke/WordPressComKit/tags","blobs_url":"https://api.github.com/repos/koke/WordPressComKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koke/WordPressComKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koke/WordPressComKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/koke/WordPressComKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koke/WordPressComKit/statuses/{sha}","languages_url":"https://api.github.com/repos/koke/WordPressComKit/languages","stargazers_url":"https://api.github.com/repos/koke/WordPressComKit/stargazers","contributors_url":"https://api.github.com/repos/koke/WordPressComKit/contributors","subscribers_url":"https://api.github.com/repos/koke/WordPressComKit/subscribers","subscription_url":"https://api.github.com/repos/koke/WordPressComKit/subscription","commits_url":"https://api.github.com/repos/koke/WordPressComKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/koke/WordPressComKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/koke/WordPressComKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/koke/WordPressComKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/koke/WordPressComKit/contents/{+path}","compare_url":"https://api.github.com/repos/koke/WordPressComKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koke/WordPressComKit/merges","archive_url":"https://api.github.com/repos/koke/WordPressComKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koke/WordPressComKit/downloads","issues_url":"https://api.github.com/repos/koke/WordPressComKit/issues{/number}","pulls_url":"https://api.github.com/repos/koke/WordPressComKit/pulls{/number}","milestones_url":"https://api.github.com/repos/koke/WordPressComKit/milestones{/number}","notifications_url":"https://api.github.com/repos/koke/WordPressComKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koke/WordPressComKit/labels{/name}","releases_url":"https://api.github.com/repos/koke/WordPressComKit/releases{/id}","deployments_url":"https://api.github.com/repos/koke/WordPressComKit/deployments","created_at":"2016-03-09T11:58:37Z","updated_at":"2016-03-09T12:06:48Z","pushed_at":"2016-03-09T12:08:19Z","git_url":"git://github.com/koke/WordPressComKit.git","ssh_url":"git@github.com:koke/WordPressComKit.git","clone_url":"https://github.com/koke/WordPressComKit.git","svn_url":"https://github.com/koke/WordPressComKit","homepage":"https://github.com/Automattic/WordPressComKit","size":49,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"initial-review"}},"base":{"label":"koke:start","ref":"start","sha":"06b7d12a56a3a0a9caeaec24a79f0ef03df73571","user":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"repo":{"id":53494158,"name":"WordPressComKit","full_name":"koke/WordPressComKit","owner":{"login":"koke","id":8739,"avatar_url":"https://avatars.githubusercontent.com/u/8739?v=3","gravatar_id":"","url":"https://api.github.com/users/koke","html_url":"https://github.com/koke","followers_url":"https://api.github.com/users/koke/followers","following_url":"https://api.github.com/users/koke/following{/other_user}","gists_url":"https://api.github.com/users/koke/gists{/gist_id}","starred_url":"https://api.github.com/users/koke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koke/subscriptions","organizations_url":"https://api.github.com/users/koke/orgs","repos_url":"https://api.github.com/users/koke/repos","events_url":"https://api.github.com/users/koke/events{/privacy}","received_events_url":"https://api.github.com/users/koke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/koke/WordPressComKit","description":"Don't look here, go here instead:","fork":false,"url":"https://api.github.com/repos/koke/WordPressComKit","forks_url":"https://api.github.com/repos/koke/WordPressComKit/forks","keys_url":"https://api.github.com/repos/koke/WordPressComKit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koke/WordPressComKit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koke/WordPressComKit/teams","hooks_url":"https://api.github.com/repos/koke/WordPressComKit/hooks","issue_events_url":"https://api.github.com/repos/koke/WordPressComKit/issues/events{/number}","events_url":"https://api.github.com/repos/koke/WordPressComKit/events","assignees_url":"https://api.github.com/repos/koke/WordPressComKit/assignees{/user}","branches_url":"https://api.github.com/repos/koke/WordPressComKit/branches{/branch}","tags_url":"https://api.github.com/repos/koke/WordPressComKit/tags","blobs_url":"https://api.github.com/repos/koke/WordPressComKit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koke/WordPressComKit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koke/WordPressComKit/git/refs{/sha}","trees_url":"https://api.github.com/repos/koke/WordPressComKit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koke/WordPressComKit/statuses/{sha}","languages_url":"https://api.github.com/repos/koke/WordPressComKit/languages","stargazers_url":"https://api.github.com/repos/koke/WordPressComKit/stargazers","contributors_url":"https://api.github.com/repos/koke/WordPressComKit/contributors","subscribers_url":"https://api.github.com/repos/koke/WordPressComKit/subscribers","subscription_url":"https://api.github.com/repos/koke/WordPressComKit/subscription","commits_url":"https://api.github.com/repos/koke/WordPressComKit/commits{/sha}","git_commits_url":"https://api.github.com/repos/koke/WordPressComKit/git/commits{/sha}","comments_url":"https://api.github.com/repos/koke/WordPressComKit/comments{/number}","issue_comment_url":"https://api.github.com/repos/koke/WordPressComKit/issues/comments{/number}","contents_url":"https://api.github.com/repos/koke/WordPressComKit/contents/{+path}","compare_url":"https://api.github.com/repos/koke/WordPressComKit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koke/WordPressComKit/merges","archive_url":"https://api.github.com/repos/koke/WordPressComKit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koke/WordPressComKit/downloads","issues_url":"https://api.github.com/repos/koke/WordPressComKit/issues{/number}","pulls_url":"https://api.github.com/repos/koke/WordPressComKit/pulls{/number}","milestones_url":"https://api.github.com/repos/koke/WordPressComKit/milestones{/number}","notifications_url":"https://api.github.com/repos/koke/WordPressComKit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koke/WordPressComKit/labels{/name}","releases_url":"https://api.github.com/repos/koke/WordPressComKit/releases{/id}","deployments_url":"https://api.github.com/repos/koke/WordPressComKit/deployments","created_at":"2016-03-09T11:58:37Z","updated_at":"2016-03-09T12:06:48Z","pushed_at":"2016-03-09T12:08:19Z","git_url":"git://github.com/koke/WordPressComKit.git","ssh_url":"git@github.com:koke/WordPressComKit.git","clone_url":"https://github.com/koke/WordPressComKit.git","svn_url":"https://github.com/koke/WordPressComKit","homepage":"https://github.com/Automattic/WordPressComKit","size":49,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"initial-review"}},"_links":{"self":{"href":"https://api.github.com/repos/koke/WordPressComKit/pulls/1"},"html":{"href":"https://github.com/koke/WordPressComKit/pull/1"},"issue":{"href":"https://api.github.com/repos/koke/WordPressComKit/issues/1"},"comments":{"href":"https://api.github.com/repos/koke/WordPressComKit/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/koke/WordPressComKit/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/koke/WordPressComKit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/koke/WordPressComKit/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/koke/WordPressComKit/statuses/c7fcc1a0c8c9241b411186a3f9ad8409b22486f3"}}}}