{"action":"created","comment":{"url":"https://api.github.com/repos/Kitware/vaui/pulls/comments/166027201","pull_request_review_id":94053407,"id":166027201,"diff_hunk":"@@ -36,16 +39,26 @@ def __init__(self):\n         self.route('DELETE', (':geomId',), self.deleteGeom)\n         self.route('GET', ('export', ':itemId',), self.exportKPF)\n \n+    # The girder default serialization takes twice the time than this custom serializer. Since geom could be relatively big, it worth to use this custom serializer. \n+    class JSONEncoder(json.JSONEncoder):\n+        def default(self, obj):\n+            if isinstance(obj, ObjectId):\n+                return str(obj)\n+            return json.JSONEncoder.default(self, obj)\n+\n     @autoDescribeRoute(\n         Description('')\n         .modelParam('itemId', model=Item, level=AccessType.READ)\n         .errorResponse()\n         .errorResponse('Read access was denied on the item.', 403)\n     )\n     @access.user\n+    @rawResponse\n     def getGeomsOfItem(self, item, params):\n+        setResponseHeader('Content-Type', 'application/json')\n         cursor = Geom().findByItem(item)\n-        return list(cursor)\n+        jsonString = self.JSONEncoder().encode(list(cursor))","path":"server/rest/geom.py","position":35,"original_position":33,"commit_id":"62a256fdaa884600f5cd6904768421b94cf507f3","original_commit_id":"806c9d98c3a64b05ae7e1c8ad2ee4178e6765565","user":{"login":"mwoehlke-kitware","id":6474409,"avatar_url":"https://avatars3.githubusercontent.com/u/6474409?v=4","gravatar_id":"","url":"https://api.github.com/users/mwoehlke-kitware","html_url":"https://github.com/mwoehlke-kitware","followers_url":"https://api.github.com/users/mwoehlke-kitware/followers","following_url":"https://api.github.com/users/mwoehlke-kitware/following{/other_user}","gists_url":"https://api.github.com/users/mwoehlke-kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/mwoehlke-kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwoehlke-kitware/subscriptions","organizations_url":"https://api.github.com/users/mwoehlke-kitware/orgs","repos_url":"https://api.github.com/users/mwoehlke-kitware/repos","events_url":"https://api.github.com/users/mwoehlke-kitware/events{/privacy}","received_events_url":"https://api.github.com/users/mwoehlke-kitware/received_events","type":"User","site_admin":false},"body":"It's not *wrong*, per se, it just feels gratuitous... hence why the original comment is phrased as a question.","created_at":"2018-02-05T16:30:59Z","updated_at":"2018-02-05T16:30:59Z","html_url":"https://github.com/Kitware/vaui/pull/46#discussion_r166027201","pull_request_url":"https://api.github.com/repos/Kitware/vaui/pulls/46","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Kitware/vaui/pulls/comments/166027201"},"html":{"href":"https://github.com/Kitware/vaui/pull/46#discussion_r166027201"},"pull_request":{"href":"https://api.github.com/repos/Kitware/vaui/pulls/46"}},"in_reply_to_id":164803264},"pull_request":{"url":"https://api.github.com/repos/Kitware/vaui/pulls/46","id":166022383,"html_url":"https://github.com/Kitware/vaui/pull/46","diff_url":"https://github.com/Kitware/vaui/pull/46.diff","patch_url":"https://github.com/Kitware/vaui/pull/46.patch","issue_url":"https://api.github.com/repos/Kitware/vaui/issues/46","number":46,"state":"open","locked":false,"title":"Some improvements","user":{"login":"matthewma7","id":3123478,"avatar_url":"https://avatars3.githubusercontent.com/u/3123478?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewma7","html_url":"https://github.com/matthewma7","followers_url":"https://api.github.com/users/matthewma7/followers","following_url":"https://api.github.com/users/matthewma7/following{/other_user}","gists_url":"https://api.github.com/users/matthewma7/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewma7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewma7/subscriptions","organizations_url":"https://api.github.com/users/matthewma7/orgs","repos_url":"https://api.github.com/users/matthewma7/repos","events_url":"https://api.github.com/users/matthewma7/events{/privacy}","received_events_url":"https://api.github.com/users/matthewma7/received_events","type":"User","site_admin":false},"body":"See commit comment for details","created_at":"2018-01-30T16:00:57Z","updated_at":"2018-02-05T16:30:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"192255abdd22c8a55bd690a34058d0ed2dd88dcc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/Kitware/vaui/pulls/46/commits","review_comments_url":"https://api.github.com/repos/Kitware/vaui/pulls/46/comments","review_comment_url":"https://api.github.com/repos/Kitware/vaui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kitware/vaui/issues/46/comments","statuses_url":"https://api.github.com/repos/Kitware/vaui/statuses/62a256fdaa884600f5cd6904768421b94cf507f3","head":{"label":"Kitware:some_improvements","ref":"some_improvements","sha":"62a256fdaa884600f5cd6904768421b94cf507f3","user":{"login":"Kitware","id":87549,"avatar_url":"https://avatars3.githubusercontent.com/u/87549?v=4","gravatar_id":"","url":"https://api.github.com/users/Kitware","html_url":"https://github.com/Kitware","followers_url":"https://api.github.com/users/Kitware/followers","following_url":"https://api.github.com/users/Kitware/following{/other_user}","gists_url":"https://api.github.com/users/Kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/Kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kitware/subscriptions","organizations_url":"https://api.github.com/users/Kitware/orgs","repos_url":"https://api.github.com/users/Kitware/repos","events_url":"https://api.github.com/users/Kitware/events{/privacy}","received_events_url":"https://api.github.com/users/Kitware/received_events","type":"Organization","site_admin":false},"repo":{"id":105031540,"name":"vaui","full_name":"Kitware/vaui","owner":{"login":"Kitware","id":87549,"avatar_url":"https://avatars3.githubusercontent.com/u/87549?v=4","gravatar_id":"","url":"https://api.github.com/users/Kitware","html_url":"https://github.com/Kitware","followers_url":"https://api.github.com/users/Kitware/followers","following_url":"https://api.github.com/users/Kitware/following{/other_user}","gists_url":"https://api.github.com/users/Kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/Kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kitware/subscriptions","organizations_url":"https://api.github.com/users/Kitware/orgs","repos_url":"https://api.github.com/users/Kitware/repos","events_url":"https://api.github.com/users/Kitware/events{/privacy}","received_events_url":"https://api.github.com/users/Kitware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kitware/vaui","description":null,"fork":false,"url":"https://api.github.com/repos/Kitware/vaui","forks_url":"https://api.github.com/repos/Kitware/vaui/forks","keys_url":"https://api.github.com/repos/Kitware/vaui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kitware/vaui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kitware/vaui/teams","hooks_url":"https://api.github.com/repos/Kitware/vaui/hooks","issue_events_url":"https://api.github.com/repos/Kitware/vaui/issues/events{/number}","events_url":"https://api.github.com/repos/Kitware/vaui/events","assignees_url":"https://api.github.com/repos/Kitware/vaui/assignees{/user}","branches_url":"https://api.github.com/repos/Kitware/vaui/branches{/branch}","tags_url":"https://api.github.com/repos/Kitware/vaui/tags","blobs_url":"https://api.github.com/repos/Kitware/vaui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kitware/vaui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kitware/vaui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kitware/vaui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kitware/vaui/statuses/{sha}","languages_url":"https://api.github.com/repos/Kitware/vaui/languages","stargazers_url":"https://api.github.com/repos/Kitware/vaui/stargazers","contributors_url":"https://api.github.com/repos/Kitware/vaui/contributors","subscribers_url":"https://api.github.com/repos/Kitware/vaui/subscribers","subscription_url":"https://api.github.com/repos/Kitware/vaui/subscription","commits_url":"https://api.github.com/repos/Kitware/vaui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kitware/vaui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kitware/vaui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kitware/vaui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kitware/vaui/contents/{+path}","compare_url":"https://api.github.com/repos/Kitware/vaui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kitware/vaui/merges","archive_url":"https://api.github.com/repos/Kitware/vaui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kitware/vaui/downloads","issues_url":"https://api.github.com/repos/Kitware/vaui/issues{/number}","pulls_url":"https://api.github.com/repos/Kitware/vaui/pulls{/number}","milestones_url":"https://api.github.com/repos/Kitware/vaui/milestones{/number}","notifications_url":"https://api.github.com/repos/Kitware/vaui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kitware/vaui/labels{/name}","releases_url":"https://api.github.com/repos/Kitware/vaui/releases{/id}","deployments_url":"https://api.github.com/repos/Kitware/vaui/deployments","created_at":"2017-09-27T14:52:28Z","updated_at":"2018-01-12T18:14:38Z","pushed_at":"2018-02-05T16:02:14Z","git_url":"git://github.com/Kitware/vaui.git","ssh_url":"git@github.com:Kitware/vaui.git","clone_url":"https://github.com/Kitware/vaui.git","svn_url":"https://github.com/Kitware/vaui","homepage":null,"size":269,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":7,"watchers":6,"default_branch":"master"}},"base":{"label":"Kitware:master","ref":"master","sha":"499905d338a00046d2d8d5f3bec352447e665eaf","user":{"login":"Kitware","id":87549,"avatar_url":"https://avatars3.githubusercontent.com/u/87549?v=4","gravatar_id":"","url":"https://api.github.com/users/Kitware","html_url":"https://github.com/Kitware","followers_url":"https://api.github.com/users/Kitware/followers","following_url":"https://api.github.com/users/Kitware/following{/other_user}","gists_url":"https://api.github.com/users/Kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/Kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kitware/subscriptions","organizations_url":"https://api.github.com/users/Kitware/orgs","repos_url":"https://api.github.com/users/Kitware/repos","events_url":"https://api.github.com/users/Kitware/events{/privacy}","received_events_url":"https://api.github.com/users/Kitware/received_events","type":"Organization","site_admin":false},"repo":{"id":105031540,"name":"vaui","full_name":"Kitware/vaui","owner":{"login":"Kitware","id":87549,"avatar_url":"https://avatars3.githubusercontent.com/u/87549?v=4","gravatar_id":"","url":"https://api.github.com/users/Kitware","html_url":"https://github.com/Kitware","followers_url":"https://api.github.com/users/Kitware/followers","following_url":"https://api.github.com/users/Kitware/following{/other_user}","gists_url":"https://api.github.com/users/Kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/Kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kitware/subscriptions","organizations_url":"https://api.github.com/users/Kitware/orgs","repos_url":"https://api.github.com/users/Kitware/repos","events_url":"https://api.github.com/users/Kitware/events{/privacy}","received_events_url":"https://api.github.com/users/Kitware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kitware/vaui","description":null,"fork":false,"url":"https://api.github.com/repos/Kitware/vaui","forks_url":"https://api.github.com/repos/Kitware/vaui/forks","keys_url":"https://api.github.com/repos/Kitware/vaui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kitware/vaui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kitware/vaui/teams","hooks_url":"https://api.github.com/repos/Kitware/vaui/hooks","issue_events_url":"https://api.github.com/repos/Kitware/vaui/issues/events{/number}","events_url":"https://api.github.com/repos/Kitware/vaui/events","assignees_url":"https://api.github.com/repos/Kitware/vaui/assignees{/user}","branches_url":"https://api.github.com/repos/Kitware/vaui/branches{/branch}","tags_url":"https://api.github.com/repos/Kitware/vaui/tags","blobs_url":"https://api.github.com/repos/Kitware/vaui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kitware/vaui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kitware/vaui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kitware/vaui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kitware/vaui/statuses/{sha}","languages_url":"https://api.github.com/repos/Kitware/vaui/languages","stargazers_url":"https://api.github.com/repos/Kitware/vaui/stargazers","contributors_url":"https://api.github.com/repos/Kitware/vaui/contributors","subscribers_url":"https://api.github.com/repos/Kitware/vaui/subscribers","subscription_url":"https://api.github.com/repos/Kitware/vaui/subscription","commits_url":"https://api.github.com/repos/Kitware/vaui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kitware/vaui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kitware/vaui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kitware/vaui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kitware/vaui/contents/{+path}","compare_url":"https://api.github.com/repos/Kitware/vaui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kitware/vaui/merges","archive_url":"https://api.github.com/repos/Kitware/vaui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kitware/vaui/downloads","issues_url":"https://api.github.com/repos/Kitware/vaui/issues{/number}","pulls_url":"https://api.github.com/repos/Kitware/vaui/pulls{/number}","milestones_url":"https://api.github.com/repos/Kitware/vaui/milestones{/number}","notifications_url":"https://api.github.com/repos/Kitware/vaui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kitware/vaui/labels{/name}","releases_url":"https://api.github.com/repos/Kitware/vaui/releases{/id}","deployments_url":"https://api.github.com/repos/Kitware/vaui/deployments","created_at":"2017-09-27T14:52:28Z","updated_at":"2018-01-12T18:14:38Z","pushed_at":"2018-02-05T16:02:14Z","git_url":"git://github.com/Kitware/vaui.git","ssh_url":"git@github.com:Kitware/vaui.git","clone_url":"https://github.com/Kitware/vaui.git","svn_url":"https://github.com/Kitware/vaui","homepage":null,"size":269,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":7,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kitware/vaui/pulls/46"},"html":{"href":"https://github.com/Kitware/vaui/pull/46"},"issue":{"href":"https://api.github.com/repos/Kitware/vaui/issues/46"},"comments":{"href":"https://api.github.com/repos/Kitware/vaui/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/Kitware/vaui/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/Kitware/vaui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kitware/vaui/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/Kitware/vaui/statuses/62a256fdaa884600f5cd6904768421b94cf507f3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mwoehlke-kitware"}}