{"action":"created","comment":{"url":"https://api.github.com/repos/musicglue/mg-express/pulls/comments/78539724","id":78539724,"diff_hunk":"@@ -0,0 +1,34 @@\n+import chai, { expect } from 'chai';\n+import dirtyChai from 'dirty-chai';\n+import asPromised from 'chai-as-promised';\n+\n+import validate from '../src/validateJoi';\n+\n+chai.use(asPromised);\n+chai.use(dirtyChai);\n+\n+describe('joi validation', () => {\n+  context('when the schema is not valid', () => {\n+    const schema = {\n+      validate: (value, callback) => {\n+        const err = new Error();\n+        err.name = 'ValidationError';\n+\n+        return callback(err);\n+      },\n+    };\n+\n+    it('rejects', () => expect(validate(schema, null)).to.be.rejected());\n+\n+    it('sets the error code to 400', () => validate(schema, null)","path":"test/validateJoi.js","position":23,"original_position":23,"commit_id":"50bd0e496de79041ef52c135e006455087836e7a","original_commit_id":"61f367e074f78d4d1c6912c78a250f734ad853fb","user":{"login":"leemhenson","id":515,"avatar_url":"https://avatars.githubusercontent.com/u/515?v=3","gravatar_id":"","url":"https://api.github.com/users/leemhenson","html_url":"https://github.com/leemhenson","followers_url":"https://api.github.com/users/leemhenson/followers","following_url":"https://api.github.com/users/leemhenson/following{/other_user}","gists_url":"https://api.github.com/users/leemhenson/gists{/gist_id}","starred_url":"https://api.github.com/users/leemhenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leemhenson/subscriptions","organizations_url":"https://api.github.com/users/leemhenson/orgs","repos_url":"https://api.github.com/users/leemhenson/repos","events_url":"https://api.github.com/users/leemhenson/events{/privacy}","received_events_url":"https://api.github.com/users/leemhenson/received_events","type":"User","site_admin":false},"body":"I suppose the wording is ambiguous depending on where you read a description. I've always understood it to be:\r\n\r\n`400` - something is fundamentally broken in the request, e.g. invalid request message framing\r\n`422` - \"generally everything looks good and I can read the body ok, but the body is malformed vs what I expect\"\r\n`409` - \"the request is correctly formed and I would love to process it but cannot due to the current state of the application\"","created_at":"2016-09-13T11:22:04Z","updated_at":"2016-09-13T11:22:04Z","html_url":"https://github.com/musicglue/mg-express/pull/48#discussion_r78539724","pull_request_url":"https://api.github.com/repos/musicglue/mg-express/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/musicglue/mg-express/pulls/comments/78539724"},"html":{"href":"https://github.com/musicglue/mg-express/pull/48#discussion_r78539724"},"pull_request":{"href":"https://api.github.com/repos/musicglue/mg-express/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/musicglue/mg-express/pulls/48","id":85026560,"html_url":"https://github.com/musicglue/mg-express/pull/48","diff_url":"https://github.com/musicglue/mg-express/pull/48.diff","patch_url":"https://github.com/musicglue/mg-express/pull/48.patch","issue_url":"https://api.github.com/repos/musicglue/mg-express/issues/48","number":48,"state":"open","locked":false,"title":"[validateJoi] add validate joi","user":{"login":"freesteph","id":107635,"avatar_url":"https://avatars.githubusercontent.com/u/107635?v=3","gravatar_id":"","url":"https://api.github.com/users/freesteph","html_url":"https://github.com/freesteph","followers_url":"https://api.github.com/users/freesteph/followers","following_url":"https://api.github.com/users/freesteph/following{/other_user}","gists_url":"https://api.github.com/users/freesteph/gists{/gist_id}","starred_url":"https://api.github.com/users/freesteph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freesteph/subscriptions","organizations_url":"https://api.github.com/users/freesteph/orgs","repos_url":"https://api.github.com/users/freesteph/repos","events_url":"https://api.github.com/users/freesteph/events{/privacy}","received_events_url":"https://api.github.com/users/freesteph/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-13T10:58:26Z","updated_at":"2016-09-13T11:22:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d1c48e37ccc95133d44e79b3e883881cdf174c8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/musicglue/mg-express/pulls/48/commits","review_comments_url":"https://api.github.com/repos/musicglue/mg-express/pulls/48/comments","review_comment_url":"https://api.github.com/repos/musicglue/mg-express/pulls/comments{/number}","comments_url":"https://api.github.com/repos/musicglue/mg-express/issues/48/comments","statuses_url":"https://api.github.com/repos/musicglue/mg-express/statuses/50bd0e496de79041ef52c135e006455087836e7a","head":{"label":"musicglue:feature/validate-joi","ref":"feature/validate-joi","sha":"50bd0e496de79041ef52c135e006455087836e7a","user":{"login":"musicglue","id":1974129,"avatar_url":"https://avatars.githubusercontent.com/u/1974129?v=3","gravatar_id":"","url":"https://api.github.com/users/musicglue","html_url":"https://github.com/musicglue","followers_url":"https://api.github.com/users/musicglue/followers","following_url":"https://api.github.com/users/musicglue/following{/other_user}","gists_url":"https://api.github.com/users/musicglue/gists{/gist_id}","starred_url":"https://api.github.com/users/musicglue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musicglue/subscriptions","organizations_url":"https://api.github.com/users/musicglue/orgs","repos_url":"https://api.github.com/users/musicglue/repos","events_url":"https://api.github.com/users/musicglue/events{/privacy}","received_events_url":"https://api.github.com/users/musicglue/received_events","type":"Organization","site_admin":false},"repo":{"id":55170499,"name":"mg-express","full_name":"musicglue/mg-express","owner":{"login":"musicglue","id":1974129,"avatar_url":"https://avatars.githubusercontent.com/u/1974129?v=3","gravatar_id":"","url":"https://api.github.com/users/musicglue","html_url":"https://github.com/musicglue","followers_url":"https://api.github.com/users/musicglue/followers","following_url":"https://api.github.com/users/musicglue/following{/other_user}","gists_url":"https://api.github.com/users/musicglue/gists{/gist_id}","starred_url":"https://api.github.com/users/musicglue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musicglue/subscriptions","organizations_url":"https://api.github.com/users/musicglue/orgs","repos_url":"https://api.github.com/users/musicglue/repos","events_url":"https://api.github.com/users/musicglue/events{/privacy}","received_events_url":"https://api.github.com/users/musicglue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/musicglue/mg-express","description":"Express stuff used on all musicglue services","fork":false,"url":"https://api.github.com/repos/musicglue/mg-express","forks_url":"https://api.github.com/repos/musicglue/mg-express/forks","keys_url":"https://api.github.com/repos/musicglue/mg-express/keys{/key_id}","collaborators_url":"https://api.github.com/repos/musicglue/mg-express/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/musicglue/mg-express/teams","hooks_url":"https://api.github.com/repos/musicglue/mg-express/hooks","issue_events_url":"https://api.github.com/repos/musicglue/mg-express/issues/events{/number}","events_url":"https://api.github.com/repos/musicglue/mg-express/events","assignees_url":"https://api.github.com/repos/musicglue/mg-express/assignees{/user}","branches_url":"https://api.github.com/repos/musicglue/mg-express/branches{/branch}","tags_url":"https://api.github.com/repos/musicglue/mg-express/tags","blobs_url":"https://api.github.com/repos/musicglue/mg-express/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/musicglue/mg-express/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/musicglue/mg-express/git/refs{/sha}","trees_url":"https://api.github.com/repos/musicglue/mg-express/git/trees{/sha}","statuses_url":"https://api.github.com/repos/musicglue/mg-express/statuses/{sha}","languages_url":"https://api.github.com/repos/musicglue/mg-express/languages","stargazers_url":"https://api.github.com/repos/musicglue/mg-express/stargazers","contributors_url":"https://api.github.com/repos/musicglue/mg-express/contributors","subscribers_url":"https://api.github.com/repos/musicglue/mg-express/subscribers","subscription_url":"https://api.github.com/repos/musicglue/mg-express/subscription","commits_url":"https://api.github.com/repos/musicglue/mg-express/commits{/sha}","git_commits_url":"https://api.github.com/repos/musicglue/mg-express/git/commits{/sha}","comments_url":"https://api.github.com/repos/musicglue/mg-express/comments{/number}","issue_comment_url":"https://api.github.com/repos/musicglue/mg-express/issues/comments{/number}","contents_url":"https://api.github.com/repos/musicglue/mg-express/contents/{+path}","compare_url":"https://api.github.com/repos/musicglue/mg-express/compare/{base}...{head}","merges_url":"https://api.github.com/repos/musicglue/mg-express/merges","archive_url":"https://api.github.com/repos/musicglue/mg-express/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/musicglue/mg-express/downloads","issues_url":"https://api.github.com/repos/musicglue/mg-express/issues{/number}","pulls_url":"https://api.github.com/repos/musicglue/mg-express/pulls{/number}","milestones_url":"https://api.github.com/repos/musicglue/mg-express/milestones{/number}","notifications_url":"https://api.github.com/repos/musicglue/mg-express/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/musicglue/mg-express/labels{/name}","releases_url":"https://api.github.com/repos/musicglue/mg-express/releases{/id}","deployments_url":"https://api.github.com/repos/musicglue/mg-express/deployments","created_at":"2016-03-31T17:37:37Z","updated_at":"2016-04-04T08:21:15Z","pushed_at":"2016-09-13T11:14:45Z","git_url":"git://github.com/musicglue/mg-express.git","ssh_url":"git@github.com:musicglue/mg-express.git","clone_url":"https://github.com/musicglue/mg-express.git","svn_url":"https://github.com/musicglue/mg-express","homepage":null,"size":83,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"musicglue:master","ref":"master","sha":"14aff26327d6b6546b6472538811e13c49dbfa41","user":{"login":"musicglue","id":1974129,"avatar_url":"https://avatars.githubusercontent.com/u/1974129?v=3","gravatar_id":"","url":"https://api.github.com/users/musicglue","html_url":"https://github.com/musicglue","followers_url":"https://api.github.com/users/musicglue/followers","following_url":"https://api.github.com/users/musicglue/following{/other_user}","gists_url":"https://api.github.com/users/musicglue/gists{/gist_id}","starred_url":"https://api.github.com/users/musicglue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musicglue/subscriptions","organizations_url":"https://api.github.com/users/musicglue/orgs","repos_url":"https://api.github.com/users/musicglue/repos","events_url":"https://api.github.com/users/musicglue/events{/privacy}","received_events_url":"https://api.github.com/users/musicglue/received_events","type":"Organization","site_admin":false},"repo":{"id":55170499,"name":"mg-express","full_name":"musicglue/mg-express","owner":{"login":"musicglue","id":1974129,"avatar_url":"https://avatars.githubusercontent.com/u/1974129?v=3","gravatar_id":"","url":"https://api.github.com/users/musicglue","html_url":"https://github.com/musicglue","followers_url":"https://api.github.com/users/musicglue/followers","following_url":"https://api.github.com/users/musicglue/following{/other_user}","gists_url":"https://api.github.com/users/musicglue/gists{/gist_id}","starred_url":"https://api.github.com/users/musicglue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musicglue/subscriptions","organizations_url":"https://api.github.com/users/musicglue/orgs","repos_url":"https://api.github.com/users/musicglue/repos","events_url":"https://api.github.com/users/musicglue/events{/privacy}","received_events_url":"https://api.github.com/users/musicglue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/musicglue/mg-express","description":"Express stuff used on all musicglue services","fork":false,"url":"https://api.github.com/repos/musicglue/mg-express","forks_url":"https://api.github.com/repos/musicglue/mg-express/forks","keys_url":"https://api.github.com/repos/musicglue/mg-express/keys{/key_id}","collaborators_url":"https://api.github.com/repos/musicglue/mg-express/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/musicglue/mg-express/teams","hooks_url":"https://api.github.com/repos/musicglue/mg-express/hooks","issue_events_url":"https://api.github.com/repos/musicglue/mg-express/issues/events{/number}","events_url":"https://api.github.com/repos/musicglue/mg-express/events","assignees_url":"https://api.github.com/repos/musicglue/mg-express/assignees{/user}","branches_url":"https://api.github.com/repos/musicglue/mg-express/branches{/branch}","tags_url":"https://api.github.com/repos/musicglue/mg-express/tags","blobs_url":"https://api.github.com/repos/musicglue/mg-express/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/musicglue/mg-express/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/musicglue/mg-express/git/refs{/sha}","trees_url":"https://api.github.com/repos/musicglue/mg-express/git/trees{/sha}","statuses_url":"https://api.github.com/repos/musicglue/mg-express/statuses/{sha}","languages_url":"https://api.github.com/repos/musicglue/mg-express/languages","stargazers_url":"https://api.github.com/repos/musicglue/mg-express/stargazers","contributors_url":"https://api.github.com/repos/musicglue/mg-express/contributors","subscribers_url":"https://api.github.com/repos/musicglue/mg-express/subscribers","subscription_url":"https://api.github.com/repos/musicglue/mg-express/subscription","commits_url":"https://api.github.com/repos/musicglue/mg-express/commits{/sha}","git_commits_url":"https://api.github.com/repos/musicglue/mg-express/git/commits{/sha}","comments_url":"https://api.github.com/repos/musicglue/mg-express/comments{/number}","issue_comment_url":"https://api.github.com/repos/musicglue/mg-express/issues/comments{/number}","contents_url":"https://api.github.com/repos/musicglue/mg-express/contents/{+path}","compare_url":"https://api.github.com/repos/musicglue/mg-express/compare/{base}...{head}","merges_url":"https://api.github.com/repos/musicglue/mg-express/merges","archive_url":"https://api.github.com/repos/musicglue/mg-express/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/musicglue/mg-express/downloads","issues_url":"https://api.github.com/repos/musicglue/mg-express/issues{/number}","pulls_url":"https://api.github.com/repos/musicglue/mg-express/pulls{/number}","milestones_url":"https://api.github.com/repos/musicglue/mg-express/milestones{/number}","notifications_url":"https://api.github.com/repos/musicglue/mg-express/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/musicglue/mg-express/labels{/name}","releases_url":"https://api.github.com/repos/musicglue/mg-express/releases{/id}","deployments_url":"https://api.github.com/repos/musicglue/mg-express/deployments","created_at":"2016-03-31T17:37:37Z","updated_at":"2016-04-04T08:21:15Z","pushed_at":"2016-09-13T11:14:45Z","git_url":"git://github.com/musicglue/mg-express.git","ssh_url":"git@github.com:musicglue/mg-express.git","clone_url":"https://github.com/musicglue/mg-express.git","svn_url":"https://github.com/musicglue/mg-express","homepage":null,"size":83,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/musicglue/mg-express/pulls/48"},"html":{"href":"https://github.com/musicglue/mg-express/pull/48"},"issue":{"href":"https://api.github.com/repos/musicglue/mg-express/issues/48"},"comments":{"href":"https://api.github.com/repos/musicglue/mg-express/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/musicglue/mg-express/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/musicglue/mg-express/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/musicglue/mg-express/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/musicglue/mg-express/statuses/50bd0e496de79041ef52c135e006455087836e7a"}}}}
{"actor":{"display_login":"leemhenson"}}