GitHub PullRequestReviewCommentEvent at 2014-08-11 12:16:28
Repository: gavel.js
Actor: kuba-kubula
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/apiaryio/gavel.js/pulls/comments/16049377","id":16049377,"diff_hunk":"@@ -191,21 +187,15 @@ class Validatable\n           @validation.body.expectedType = 'application/schema+json'          \n     else\n \n-      isJsonContentType = false\n-      # TODO refactor to separate unit when adding more complicated logic\n-      # e.g. for application/hal+json or or application/vnd.apiary.something\n-      if !(@expected.headers == undefined) and !(@expected.headers['content-type']  == undefined)\n-        contentType = @expected.headers['content-type'].split(';')[0]\n-\n-        isJsonContentType = contentType == 'application/json'\n+      contentType = @expected.headers?['content-type']\n \n-      if isJsonContentType\n+      if @isJsonContentType contentType\n         try\n           jsonlint.parse @expected.body\n-          @validation.body.expectedType = 'application/json'\n+          @validation.body.expectedType = @expected.headers['content-type']","path":"src/mixins/validatable-http-message.coffee","position":49,"original_position":49,"commit_id":"372f0b7d7e66f0ef9454c1f25318952d7b769cab","original_commit_id":"372f0b7d7e66f0ef9454c1f25318952d7b769cab","user":{"login":"kuba-kubula","id":136198,"avatar_url":"https://avatars.githubusercontent.com/u/136198?v=2","gravatar_id":"ba9e69315d0f4460caae5242bb93c745","url":"https://api.github.com/users/kuba-kubula","html_url":"https://github.com/kuba-kubula","followers_url":"https://api.github.com/users/kuba-kubula/followers","following_url":"https://api.github.com/users/kuba-kubula/following{/other_user}","gists_url":"https://api.github.com/users/kuba-kubula/gists{/gist_id}","starred_url":"https://api.github.com/users/kuba-kubula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuba-kubula/subscriptions","organizations_url":"https://api.github.com/users/kuba-kubula/orgs","repos_url":"https://api.github.com/users/kuba-kubula/repos","events_url":"https://api.github.com/users/kuba-kubula/events{/privacy}","received_events_url":"https://api.github.com/users/kuba-kubula/received_events","type":"User","site_admin":false},"body":"dtto with `contentType` reuse","created_at":"2014-08-11T12:16:28Z","updated_at":"2014-08-11T12:16:28Z","html_url":"https://github.com/apiaryio/gavel.js/pull/44#discussion_r16049377","pull_request_url":"https://api.github.com/repos/apiaryio/gavel.js/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/apiaryio/gavel.js/pulls/comments/16049377"},"html":{"href":"https://github.com/apiaryio/gavel.js/pull/44#discussion_r16049377"},"pull_request":{"href":"https://api.github.com/repos/apiaryio/gavel.js/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/apiaryio/gavel.js/pulls/44","id":19596940,"html_url":"https://github.com/apiaryio/gavel.js/pull/44","diff_url":"https://github.com/apiaryio/gavel.js/pull/44.diff","patch_url":"https://github.com/apiaryio/gavel.js/pull/44.patch","issue_url":"https://api.github.com/repos/apiaryio/gavel.js/issues/44","number":44,"state":"open","title":"+json suffix support e.g. application/hal+json","user":{"login":"netmilk","id":79609,"avatar_url":"https://avatars.githubusercontent.com/u/79609?v=2","gravatar_id":"412d6132996a6a5421f6ce3470568f12","url":"https://api.github.com/users/netmilk","html_url":"https://github.com/netmilk","followers_url":"https://api.github.com/users/netmilk/followers","following_url":"https://api.github.com/users/netmilk/following{/other_user}","gists_url":"https://api.github.com/users/netmilk/gists{/gist_id}","starred_url":"https://api.github.com/users/netmilk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netmilk/subscriptions","organizations_url":"https://api.github.com/users/netmilk/orgs","repos_url":"https://api.github.com/users/netmilk/repos","events_url":"https://api.github.com/users/netmilk/events{/privacy}","received_events_url":"https://api.github.com/users/netmilk/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-08-11T12:12:28Z","updated_at":"2014-08-11T12:16:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d807def799509faa50da53ee31ab7cd0bb94942","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apiaryio/gavel.js/pulls/44/commits","review_comments_url":"https://api.github.com/repos/apiaryio/gavel.js/pulls/44/comments","review_comment_url":"https://api.github.com/repos/apiaryio/gavel.js/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apiaryio/gavel.js/issues/44/comments","statuses_url":"https://api.github.com/repos/apiaryio/gavel.js/statuses/372f0b7d7e66f0ef9454c1f25318952d7b769cab","head":{"label":"apiaryio:netmilk/json-suffix","ref":"netmilk/json-suffix","sha":"372f0b7d7e66f0ef9454c1f25318952d7b769cab","user":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=2","gravatar_id":"c64b5c51ede2fbd878595bf27bc4d630","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"repo":{"id":10646031,"name":"gavel.js","full_name":"apiaryio/gavel.js","owner":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=2","gravatar_id":"c64b5c51ede2fbd878595bf27bc4d630","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apiaryio/gavel.js","description":"Gavel HTTP validator JavaScript library","fork":false,"url":"https://api.github.com/repos/apiaryio/gavel.js","forks_url":"https://api.github.com/repos/apiaryio/gavel.js/forks","keys_url":"https://api.github.com/repos/apiaryio/gavel.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiaryio/gavel.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiaryio/gavel.js/teams","hooks_url":"https://api.github.com/repos/apiaryio/gavel.js/hooks","issue_events_url":"https://api.github.com/repos/apiaryio/gavel.js/issues/events{/number}","events_url":"https://api.github.com/repos/apiaryio/gavel.js/events","assignees_url":"https://api.github.com/repos/apiaryio/gavel.js/assignees{/user}","branches_url":"https://api.github.com/repos/apiaryio/gavel.js/branches{/branch}","tags_url":"https://api.github.com/repos/apiaryio/gavel.js/tags","blobs_url":"https://api.github.com/repos/apiaryio/gavel.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiaryio/gavel.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiaryio/gavel.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiaryio/gavel.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiaryio/gavel.js/statuses/{sha}","languages_url":"https://api.github.com/repos/apiaryio/gavel.js/languages","stargazers_url":"https://api.github.com/repos/apiaryio/gavel.js/stargazers","contributors_url":"https://api.github.com/repos/apiaryio/gavel.js/contributors","subscribers_url":"https://api.github.com/repos/apiaryio/gavel.js/subscribers","subscription_url":"https://api.github.com/repos/apiaryio/gavel.js/subscription","commits_url":"https://api.github.com/repos/apiaryio/gavel.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiaryio/gavel.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiaryio/gavel.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiaryio/gavel.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/apiaryio/gavel.js/contents/{+path}","compare_url":"https://api.github.com/repos/apiaryio/gavel.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiaryio/gavel.js/merges","archive_url":"https://api.github.com/repos/apiaryio/gavel.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiaryio/gavel.js/downloads","issues_url":"https://api.github.com/repos/apiaryio/gavel.js/issues{/number}","pulls_url":"https://api.github.com/repos/apiaryio/gavel.js/pulls{/number}","milestones_url":"https://api.github.com/repos/apiaryio/gavel.js/milestones{/number}","notifications_url":"https://api.github.com/repos/apiaryio/gavel.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiaryio/gavel.js/labels{/name}","releases_url":"https://api.github.com/repos/apiaryio/gavel.js/releases{/id}","created_at":"2013-06-12T15:37:19Z","updated_at":"2014-07-22T16:23:31Z","pushed_at":"2014-08-11T11:45:17Z","git_url":"git://github.com/apiaryio/gavel.js.git","ssh_url":"git@github.com:apiaryio/gavel.js.git","clone_url":"https://github.com/apiaryio/gavel.js.git","svn_url":"https://github.com/apiaryio/gavel.js","homepage":"","size":1442,"stargazers_count":23,"watchers_count":23,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":11,"mirror_url":null,"open_issues_count":12,"forks":11,"open_issues":12,"watchers":23,"default_branch":"master"}},"base":{"label":"apiaryio:master","ref":"master","sha":"bde50441161c71f7a5d16fd47928495a42ce62c1","user":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=2","gravatar_id":"c64b5c51ede2fbd878595bf27bc4d630","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"repo":{"id":10646031,"name":"gavel.js","full_name":"apiaryio/gavel.js","owner":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=2","gravatar_id":"c64b5c51ede2fbd878595bf27bc4d630","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apiaryio/gavel.js","description":"Gavel HTTP validator JavaScript library","fork":false,"url":"https://api.github.com/repos/apiaryio/gavel.js","forks_url":"https://api.github.com/repos/apiaryio/gavel.js/forks","keys_url":"https://api.github.com/repos/apiaryio/gavel.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiaryio/gavel.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiaryio/gavel.js/teams","hooks_url":"https://api.github.com/repos/apiaryio/gavel.js/hooks","issue_events_url":"https://api.github.com/repos/apiaryio/gavel.js/issues/events{/number}","events_url":"https://api.github.com/repos/apiaryio/gavel.js/events","assignees_url":"https://api.github.com/repos/apiaryio/gavel.js/assignees{/user}","branches_url":"https://api.github.com/repos/apiaryio/gavel.js/branches{/branch}","tags_url":"https://api.github.com/repos/apiaryio/gavel.js/tags","blobs_url":"https://api.github.com/repos/apiaryio/gavel.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiaryio/gavel.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiaryio/gavel.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiaryio/gavel.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiaryio/gavel.js/statuses/{sha}","languages_url":"https://api.github.com/repos/apiaryio/gavel.js/languages","stargazers_url":"https://api.github.com/repos/apiaryio/gavel.js/stargazers","contributors_url":"https://api.github.com/repos/apiaryio/gavel.js/contributors","subscribers_url":"https://api.github.com/repos/apiaryio/gavel.js/subscribers","subscription_url":"https://api.github.com/repos/apiaryio/gavel.js/subscription","commits_url":"https://api.github.com/repos/apiaryio/gavel.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiaryio/gavel.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiaryio/gavel.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiaryio/gavel.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/apiaryio/gavel.js/contents/{+path}","compare_url":"https://api.github.com/repos/apiaryio/gavel.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiaryio/gavel.js/merges","archive_url":"https://api.github.com/repos/apiaryio/gavel.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiaryio/gavel.js/downloads","issues_url":"https://api.github.com/repos/apiaryio/gavel.js/issues{/number}","pulls_url":"https://api.github.com/repos/apiaryio/gavel.js/pulls{/number}","milestones_url":"https://api.github.com/repos/apiaryio/gavel.js/milestones{/number}","notifications_url":"https://api.github.com/repos/apiaryio/gavel.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiaryio/gavel.js/labels{/name}","releases_url":"https://api.github.com/repos/apiaryio/gavel.js/releases{/id}","created_at":"2013-06-12T15:37:19Z","updated_at":"2014-07-22T16:23:31Z","pushed_at":"2014-08-11T11:45:17Z","git_url":"git://github.com/apiaryio/gavel.js.git","ssh_url":"git@github.com:apiaryio/gavel.js.git","clone_url":"https://github.com/apiaryio/gavel.js.git","svn_url":"https://github.com/apiaryio/gavel.js","homepage":"","size":1442,"stargazers_count":23,"watchers_count":23,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":11,"mirror_url":null,"open_issues_count":12,"forks":11,"open_issues":12,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apiaryio/gavel.js/pulls/44"},"html":{"href":"https://github.com/apiaryio/gavel.js/pull/44"},"issue":{"href":"https://api.github.com/repos/apiaryio/gavel.js/issues/44"},"comments":{"href":"https://api.github.com/repos/apiaryio/gavel.js/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/apiaryio/gavel.js/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/apiaryio/gavel.js/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apiaryio/gavel.js/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/apiaryio/gavel.js/statuses/372f0b7d7e66f0ef9454c1f25318952d7b769cab"}}}}