{"action":"created","comment":{"url":"https://api.github.com/repos/ifwe/monocle-api/pulls/comments/57774520","id":57774520,"diff_hunk":"@@ -514,8 +520,8 @@ RequestRouter.prototype.addPropertyError = function(property, errorCode) {\n         });\n     }\n \n-    if (this._request.getMethod() == Request.METHOD_POST && this.isCollection()) {\n-        //remove the appended items@ if posting to a collection\n+    if (!!~[Request.METHOD_PATCH, Request.METHOD_POST, Request.METHOD_PUT, Request.METHOD_DELETE].indexOf(this.getMethod()) && this.isCollection()) {","path":"lib/RequestRouter.js","position":58,"original_position":58,"commit_id":"25d65afa033a345467612a2f8f14b7d3d445bc17","original_commit_id":"25d65afa033a345467612a2f8f14b7d3d445bc17","user":{"login":"djvirgen","id":308786,"avatar_url":"https://avatars.githubusercontent.com/u/308786?v=3","gravatar_id":"","url":"https://api.github.com/users/djvirgen","html_url":"https://github.com/djvirgen","followers_url":"https://api.github.com/users/djvirgen/followers","following_url":"https://api.github.com/users/djvirgen/following{/other_user}","gists_url":"https://api.github.com/users/djvirgen/gists{/gist_id}","starred_url":"https://api.github.com/users/djvirgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djvirgen/subscriptions","organizations_url":"https://api.github.com/users/djvirgen/orgs","repos_url":"https://api.github.com/users/djvirgen/repos","events_url":"https://api.github.com/users/djvirgen/events{/privacy}","received_events_url":"https://api.github.com/users/djvirgen/received_events","type":"User","site_admin":false},"body":"If you want to patch an individual item in a collection, you would use the uri of that specific item. For example, to create a new User I would `POST` a single object to `/users`, which is normally a collection endpoint. To update the user, we would make a `PATCH` request to that object's URL, e.g. `/users/123`, which is not a collection endpoint.\r\n\r\nIt really comes down to `POST` not being idempotent, while the other methods are. So we need to handle it differently.","created_at":"2016-03-29T18:26:34Z","updated_at":"2016-03-29T18:26:34Z","html_url":"https://github.com/ifwe/monocle-api/pull/53#discussion_r57774520","pull_request_url":"https://api.github.com/repos/ifwe/monocle-api/pulls/53","_links":{"self":{"href":"https://api.github.com/repos/ifwe/monocle-api/pulls/comments/57774520"},"html":{"href":"https://github.com/ifwe/monocle-api/pull/53#discussion_r57774520"},"pull_request":{"href":"https://api.github.com/repos/ifwe/monocle-api/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/ifwe/monocle-api/pulls/53","id":64399569,"html_url":"https://github.com/ifwe/monocle-api/pull/53","diff_url":"https://github.com/ifwe/monocle-api/pull/53.diff","patch_url":"https://github.com/ifwe/monocle-api/pull/53.patch","issue_url":"https://api.github.com/repos/ifwe/monocle-api/issues/53","number":53,"state":"open","locked":false,"title":"Fix more bugs","user":{"login":"marianeaj","id":1957504,"avatar_url":"https://avatars.githubusercontent.com/u/1957504?v=3","gravatar_id":"","url":"https://api.github.com/users/marianeaj","html_url":"https://github.com/marianeaj","followers_url":"https://api.github.com/users/marianeaj/followers","following_url":"https://api.github.com/users/marianeaj/following{/other_user}","gists_url":"https://api.github.com/users/marianeaj/gists{/gist_id}","starred_url":"https://api.github.com/users/marianeaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marianeaj/subscriptions","organizations_url":"https://api.github.com/users/marianeaj/orgs","repos_url":"https://api.github.com/users/marianeaj/repos","events_url":"https://api.github.com/users/marianeaj/events{/privacy}","received_events_url":"https://api.github.com/users/marianeaj/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-29T01:01:44Z","updated_at":"2016-03-29T18:26:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ebc5b65d12220114a85fb3b1855c37639885fe01","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ifwe/monocle-api/pulls/53/commits","review_comments_url":"https://api.github.com/repos/ifwe/monocle-api/pulls/53/comments","review_comment_url":"https://api.github.com/repos/ifwe/monocle-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ifwe/monocle-api/issues/53/comments","statuses_url":"https://api.github.com/repos/ifwe/monocle-api/statuses/25d65afa033a345467612a2f8f14b7d3d445bc17","head":{"label":"ifwe:fix_more_bugs","ref":"fix_more_bugs","sha":"25d65afa033a345467612a2f8f14b7d3d445bc17","user":{"login":"ifwe","id":8762479,"avatar_url":"https://avatars.githubusercontent.com/u/8762479?v=3","gravatar_id":"","url":"https://api.github.com/users/ifwe","html_url":"https://github.com/ifwe","followers_url":"https://api.github.com/users/ifwe/followers","following_url":"https://api.github.com/users/ifwe/following{/other_user}","gists_url":"https://api.github.com/users/ifwe/gists{/gist_id}","starred_url":"https://api.github.com/users/ifwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifwe/subscriptions","organizations_url":"https://api.github.com/users/ifwe/orgs","repos_url":"https://api.github.com/users/ifwe/repos","events_url":"https://api.github.com/users/ifwe/events{/privacy}","received_events_url":"https://api.github.com/users/ifwe/received_events","type":"Organization","site_admin":false},"repo":{"id":41873773,"name":"monocle-api","full_name":"ifwe/monocle-api","owner":{"login":"ifwe","id":8762479,"avatar_url":"https://avatars.githubusercontent.com/u/8762479?v=3","gravatar_id":"","url":"https://api.github.com/users/ifwe","html_url":"https://github.com/ifwe","followers_url":"https://api.github.com/users/ifwe/followers","following_url":"https://api.github.com/users/ifwe/following{/other_user}","gists_url":"https://api.github.com/users/ifwe/gists{/gist_id}","starred_url":"https://api.github.com/users/ifwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifwe/subscriptions","organizations_url":"https://api.github.com/users/ifwe/orgs","repos_url":"https://api.github.com/users/ifwe/repos","events_url":"https://api.github.com/users/ifwe/events{/privacy}","received_events_url":"https://api.github.com/users/ifwe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ifwe/monocle-api","description":"API router focused on consistency, flexibility, and performance.","fork":false,"url":"https://api.github.com/repos/ifwe/monocle-api","forks_url":"https://api.github.com/repos/ifwe/monocle-api/forks","keys_url":"https://api.github.com/repos/ifwe/monocle-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ifwe/monocle-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ifwe/monocle-api/teams","hooks_url":"https://api.github.com/repos/ifwe/monocle-api/hooks","issue_events_url":"https://api.github.com/repos/ifwe/monocle-api/issues/events{/number}","events_url":"https://api.github.com/repos/ifwe/monocle-api/events","assignees_url":"https://api.github.com/repos/ifwe/monocle-api/assignees{/user}","branches_url":"https://api.github.com/repos/ifwe/monocle-api/branches{/branch}","tags_url":"https://api.github.com/repos/ifwe/monocle-api/tags","blobs_url":"https://api.github.com/repos/ifwe/monocle-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ifwe/monocle-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ifwe/monocle-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/ifwe/monocle-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ifwe/monocle-api/statuses/{sha}","languages_url":"https://api.github.com/repos/ifwe/monocle-api/languages","stargazers_url":"https://api.github.com/repos/ifwe/monocle-api/stargazers","contributors_url":"https://api.github.com/repos/ifwe/monocle-api/contributors","subscribers_url":"https://api.github.com/repos/ifwe/monocle-api/subscribers","subscription_url":"https://api.github.com/repos/ifwe/monocle-api/subscription","commits_url":"https://api.github.com/repos/ifwe/monocle-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/ifwe/monocle-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/ifwe/monocle-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/ifwe/monocle-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/ifwe/monocle-api/contents/{+path}","compare_url":"https://api.github.com/repos/ifwe/monocle-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ifwe/monocle-api/merges","archive_url":"https://api.github.com/repos/ifwe/monocle-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ifwe/monocle-api/downloads","issues_url":"https://api.github.com/repos/ifwe/monocle-api/issues{/number}","pulls_url":"https://api.github.com/repos/ifwe/monocle-api/pulls{/number}","milestones_url":"https://api.github.com/repos/ifwe/monocle-api/milestones{/number}","notifications_url":"https://api.github.com/repos/ifwe/monocle-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ifwe/monocle-api/labels{/name}","releases_url":"https://api.github.com/repos/ifwe/monocle-api/releases{/id}","deployments_url":"https://api.github.com/repos/ifwe/monocle-api/deployments","created_at":"2015-09-03T17:29:27Z","updated_at":"2016-01-12T19:03:22Z","pushed_at":"2016-03-29T01:01:44Z","git_url":"git://github.com/ifwe/monocle-api.git","ssh_url":"git@github.com:ifwe/monocle-api.git","clone_url":"https://github.com/ifwe/monocle-api.git","svn_url":"https://github.com/ifwe/monocle-api","homepage":null,"size":337,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","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":5,"default_branch":"master"}},"base":{"label":"ifwe:master","ref":"master","sha":"7afcc6e16de664b101d9834ab57e649bb6f21284","user":{"login":"ifwe","id":8762479,"avatar_url":"https://avatars.githubusercontent.com/u/8762479?v=3","gravatar_id":"","url":"https://api.github.com/users/ifwe","html_url":"https://github.com/ifwe","followers_url":"https://api.github.com/users/ifwe/followers","following_url":"https://api.github.com/users/ifwe/following{/other_user}","gists_url":"https://api.github.com/users/ifwe/gists{/gist_id}","starred_url":"https://api.github.com/users/ifwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifwe/subscriptions","organizations_url":"https://api.github.com/users/ifwe/orgs","repos_url":"https://api.github.com/users/ifwe/repos","events_url":"https://api.github.com/users/ifwe/events{/privacy}","received_events_url":"https://api.github.com/users/ifwe/received_events","type":"Organization","site_admin":false},"repo":{"id":41873773,"name":"monocle-api","full_name":"ifwe/monocle-api","owner":{"login":"ifwe","id":8762479,"avatar_url":"https://avatars.githubusercontent.com/u/8762479?v=3","gravatar_id":"","url":"https://api.github.com/users/ifwe","html_url":"https://github.com/ifwe","followers_url":"https://api.github.com/users/ifwe/followers","following_url":"https://api.github.com/users/ifwe/following{/other_user}","gists_url":"https://api.github.com/users/ifwe/gists{/gist_id}","starred_url":"https://api.github.com/users/ifwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifwe/subscriptions","organizations_url":"https://api.github.com/users/ifwe/orgs","repos_url":"https://api.github.com/users/ifwe/repos","events_url":"https://api.github.com/users/ifwe/events{/privacy}","received_events_url":"https://api.github.com/users/ifwe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ifwe/monocle-api","description":"API router focused on consistency, flexibility, and performance.","fork":false,"url":"https://api.github.com/repos/ifwe/monocle-api","forks_url":"https://api.github.com/repos/ifwe/monocle-api/forks","keys_url":"https://api.github.com/repos/ifwe/monocle-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ifwe/monocle-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ifwe/monocle-api/teams","hooks_url":"https://api.github.com/repos/ifwe/monocle-api/hooks","issue_events_url":"https://api.github.com/repos/ifwe/monocle-api/issues/events{/number}","events_url":"https://api.github.com/repos/ifwe/monocle-api/events","assignees_url":"https://api.github.com/repos/ifwe/monocle-api/assignees{/user}","branches_url":"https://api.github.com/repos/ifwe/monocle-api/branches{/branch}","tags_url":"https://api.github.com/repos/ifwe/monocle-api/tags","blobs_url":"https://api.github.com/repos/ifwe/monocle-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ifwe/monocle-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ifwe/monocle-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/ifwe/monocle-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ifwe/monocle-api/statuses/{sha}","languages_url":"https://api.github.com/repos/ifwe/monocle-api/languages","stargazers_url":"https://api.github.com/repos/ifwe/monocle-api/stargazers","contributors_url":"https://api.github.com/repos/ifwe/monocle-api/contributors","subscribers_url":"https://api.github.com/repos/ifwe/monocle-api/subscribers","subscription_url":"https://api.github.com/repos/ifwe/monocle-api/subscription","commits_url":"https://api.github.com/repos/ifwe/monocle-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/ifwe/monocle-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/ifwe/monocle-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/ifwe/monocle-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/ifwe/monocle-api/contents/{+path}","compare_url":"https://api.github.com/repos/ifwe/monocle-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ifwe/monocle-api/merges","archive_url":"https://api.github.com/repos/ifwe/monocle-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ifwe/monocle-api/downloads","issues_url":"https://api.github.com/repos/ifwe/monocle-api/issues{/number}","pulls_url":"https://api.github.com/repos/ifwe/monocle-api/pulls{/number}","milestones_url":"https://api.github.com/repos/ifwe/monocle-api/milestones{/number}","notifications_url":"https://api.github.com/repos/ifwe/monocle-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ifwe/monocle-api/labels{/name}","releases_url":"https://api.github.com/repos/ifwe/monocle-api/releases{/id}","deployments_url":"https://api.github.com/repos/ifwe/monocle-api/deployments","created_at":"2015-09-03T17:29:27Z","updated_at":"2016-01-12T19:03:22Z","pushed_at":"2016-03-29T01:01:44Z","git_url":"git://github.com/ifwe/monocle-api.git","ssh_url":"git@github.com:ifwe/monocle-api.git","clone_url":"https://github.com/ifwe/monocle-api.git","svn_url":"https://github.com/ifwe/monocle-api","homepage":null,"size":337,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","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":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ifwe/monocle-api/pulls/53"},"html":{"href":"https://github.com/ifwe/monocle-api/pull/53"},"issue":{"href":"https://api.github.com/repos/ifwe/monocle-api/issues/53"},"comments":{"href":"https://api.github.com/repos/ifwe/monocle-api/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/ifwe/monocle-api/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/ifwe/monocle-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ifwe/monocle-api/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/ifwe/monocle-api/statuses/25d65afa033a345467612a2f8f14b7d3d445bc17"}}}}