{"action":"created","comment":{"url":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/comments/103957135","pull_request_review_id":24766078,"id":103957135,"diff_hunk":"@@ -264,10 +311,12 @@ public Response downloadZip(JsonObject content,\n             Result result = controller.execute();\n             if (result instanceof Failed)\n             {\n-               return Response.status(Status.INTERNAL_SERVER_ERROR).entity(result.getMessage()).build();\n+               return Response.status(Status.INTERNAL_SERVER_ERROR).entity(getMessage(result)).build();","path":"src/main/java/org/obsidiantoaster/generator/rest/ObsidianResource.java","position":203,"original_position":203,"commit_id":"5d10580995d665b0ae2b02325b58085ad89b8bfc","original_commit_id":"5d10580995d665b0ae2b02325b58085ad89b8bfc","user":{"login":"gastaldi","id":54133,"avatar_url":"https://avatars2.githubusercontent.com/u/54133?v=3","gravatar_id":"","url":"https://api.github.com/users/gastaldi","html_url":"https://github.com/gastaldi","followers_url":"https://api.github.com/users/gastaldi/followers","following_url":"https://api.github.com/users/gastaldi/following{/other_user}","gists_url":"https://api.github.com/users/gastaldi/gists{/gist_id}","starred_url":"https://api.github.com/users/gastaldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gastaldi/subscriptions","organizations_url":"https://api.github.com/users/gastaldi/orgs","repos_url":"https://api.github.com/users/gastaldi/repos","events_url":"https://api.github.com/users/gastaldi/events{/privacy}","received_events_url":"https://api.github.com/users/gastaldi/received_events","type":"User","site_admin":false},"body":"My idea is to change this chunk of code to: \r\n```\r\nJsonObjectBuilder builder = Json,createObjectBuilder();\r\nUICommandHelper.describeResult(builder,result)\r\nreturn Response.status(Status.INTERNAL_SERVER_ERROR).entity(builder).build(); \r\n```","created_at":"2017-03-02T15:54:16Z","updated_at":"2017-03-02T15:54:16Z","html_url":"https://github.com/obsidian-toaster/generator-backend/pull/27#discussion_r103957135","pull_request_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/comments/103957135"},"html":{"href":"https://github.com/obsidian-toaster/generator-backend/pull/27#discussion_r103957135"},"pull_request":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/27","id":108712035,"html_url":"https://github.com/obsidian-toaster/generator-backend/pull/27","diff_url":"https://github.com/obsidian-toaster/generator-backend/pull/27.diff","patch_url":"https://github.com/obsidian-toaster/generator-backend/pull/27.patch","issue_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/issues/27","number":27,"state":"open","locked":false,"title":"refactor to allow more flexible exposing of commands, mapping of commands to zip downloads and to allow optional query commands to be exposed over a nicer GET REST API","user":{"login":"jstrachan","id":30140,"avatar_url":"https://avatars2.githubusercontent.com/u/30140?v=3","gravatar_id":"","url":"https://api.github.com/users/jstrachan","html_url":"https://github.com/jstrachan","followers_url":"https://api.github.com/users/jstrachan/followers","following_url":"https://api.github.com/users/jstrachan/following{/other_user}","gists_url":"https://api.github.com/users/jstrachan/gists{/gist_id}","starred_url":"https://api.github.com/users/jstrachan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstrachan/subscriptions","organizations_url":"https://api.github.com/users/jstrachan/orgs","repos_url":"https://api.github.com/users/jstrachan/repos","events_url":"https://api.github.com/users/jstrachan/events{/privacy}","received_events_url":"https://api.github.com/users/jstrachan/received_events","type":"User","site_admin":false},"body":"its often handy when creating front end UIs to be able to query forge commands for information; such as what git accounts are setup, what project types are there (if you wanted to create a front screen before the actual wizard that pre-selects the project type) or whatever.\r\n\r\nSo this refactor makes it easy to expose a subset of commands as idempotent queries via GET with query arguments. \r\n\r\nIt also makes it easy to configure which commands generate zips and which don't. This refactor should also make it easier to plugin different kinds of REST commands in a more modular fashion. \r\n\r\nBTW here's an example of a 'query command':\r\nhttps://github.com/fabric8io/fabric8-generator/blob/master/src/main/java/io/fabric8/forge/generator/git/CheckGitAccounts.java#L47\r\n\r\nnotice that it can be used like any other forge command inside the CLI / IDE. But then when using the REST API we can query the result as JSON easily which is very handy.\r\n\r\nBTW it might be nice one day to automate the setting of `format` to JSON if the `Accept` header is set to `application/json`","created_at":"2017-03-02T08:49:33Z","updated_at":"2017-03-02T15:54:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e5aa5c5744c8e9722c97bce88942785e571a09f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/27/commits","review_comments_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/27/comments","review_comment_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/issues/27/comments","statuses_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/statuses/5d10580995d665b0ae2b02325b58085ad89b8bfc","head":{"label":"fabric8io:patches","ref":"patches","sha":"5d10580995d665b0ae2b02325b58085ad89b8bfc","user":{"login":"fabric8io","id":6074349,"avatar_url":"https://avatars2.githubusercontent.com/u/6074349?v=3","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"repo":{"id":83412764,"name":"generator-backend","full_name":"fabric8io/generator-backend","owner":{"login":"fabric8io","id":6074349,"avatar_url":"https://avatars2.githubusercontent.com/u/6074349?v=3","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fabric8io/generator-backend","description":"The back-end for the Obsidian project generator","fork":true,"url":"https://api.github.com/repos/fabric8io/generator-backend","forks_url":"https://api.github.com/repos/fabric8io/generator-backend/forks","keys_url":"https://api.github.com/repos/fabric8io/generator-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabric8io/generator-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabric8io/generator-backend/teams","hooks_url":"https://api.github.com/repos/fabric8io/generator-backend/hooks","issue_events_url":"https://api.github.com/repos/fabric8io/generator-backend/issues/events{/number}","events_url":"https://api.github.com/repos/fabric8io/generator-backend/events","assignees_url":"https://api.github.com/repos/fabric8io/generator-backend/assignees{/user}","branches_url":"https://api.github.com/repos/fabric8io/generator-backend/branches{/branch}","tags_url":"https://api.github.com/repos/fabric8io/generator-backend/tags","blobs_url":"https://api.github.com/repos/fabric8io/generator-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabric8io/generator-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabric8io/generator-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabric8io/generator-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabric8io/generator-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/fabric8io/generator-backend/languages","stargazers_url":"https://api.github.com/repos/fabric8io/generator-backend/stargazers","contributors_url":"https://api.github.com/repos/fabric8io/generator-backend/contributors","subscribers_url":"https://api.github.com/repos/fabric8io/generator-backend/subscribers","subscription_url":"https://api.github.com/repos/fabric8io/generator-backend/subscription","commits_url":"https://api.github.com/repos/fabric8io/generator-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabric8io/generator-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabric8io/generator-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabric8io/generator-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabric8io/generator-backend/contents/{+path}","compare_url":"https://api.github.com/repos/fabric8io/generator-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabric8io/generator-backend/merges","archive_url":"https://api.github.com/repos/fabric8io/generator-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabric8io/generator-backend/downloads","issues_url":"https://api.github.com/repos/fabric8io/generator-backend/issues{/number}","pulls_url":"https://api.github.com/repos/fabric8io/generator-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/fabric8io/generator-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/fabric8io/generator-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabric8io/generator-backend/labels{/name}","releases_url":"https://api.github.com/repos/fabric8io/generator-backend/releases{/id}","deployments_url":"https://api.github.com/repos/fabric8io/generator-backend/deployments","created_at":"2017-02-28T09:14:08Z","updated_at":"2017-02-28T09:14:09Z","pushed_at":"2017-03-02T14:18:17Z","git_url":"git://github.com/fabric8io/generator-backend.git","ssh_url":"git@github.com:fabric8io/generator-backend.git","clone_url":"https://github.com/fabric8io/generator-backend.git","svn_url":"https://github.com/fabric8io/generator-backend","homepage":"","size":197,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"obsidian-toaster:master","ref":"master","sha":"e727051eb0d2bb4b4b8636d0c3068084226d8cf5","user":{"login":"obsidian-toaster","id":23121540,"avatar_url":"https://avatars2.githubusercontent.com/u/23121540?v=3","gravatar_id":"","url":"https://api.github.com/users/obsidian-toaster","html_url":"https://github.com/obsidian-toaster","followers_url":"https://api.github.com/users/obsidian-toaster/followers","following_url":"https://api.github.com/users/obsidian-toaster/following{/other_user}","gists_url":"https://api.github.com/users/obsidian-toaster/gists{/gist_id}","starred_url":"https://api.github.com/users/obsidian-toaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obsidian-toaster/subscriptions","organizations_url":"https://api.github.com/users/obsidian-toaster/orgs","repos_url":"https://api.github.com/users/obsidian-toaster/repos","events_url":"https://api.github.com/users/obsidian-toaster/events{/privacy}","received_events_url":"https://api.github.com/users/obsidian-toaster/received_events","type":"Organization","site_admin":false},"repo":{"id":72767746,"name":"generator-backend","full_name":"obsidian-toaster/generator-backend","owner":{"login":"obsidian-toaster","id":23121540,"avatar_url":"https://avatars2.githubusercontent.com/u/23121540?v=3","gravatar_id":"","url":"https://api.github.com/users/obsidian-toaster","html_url":"https://github.com/obsidian-toaster","followers_url":"https://api.github.com/users/obsidian-toaster/followers","following_url":"https://api.github.com/users/obsidian-toaster/following{/other_user}","gists_url":"https://api.github.com/users/obsidian-toaster/gists{/gist_id}","starred_url":"https://api.github.com/users/obsidian-toaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obsidian-toaster/subscriptions","organizations_url":"https://api.github.com/users/obsidian-toaster/orgs","repos_url":"https://api.github.com/users/obsidian-toaster/repos","events_url":"https://api.github.com/users/obsidian-toaster/events{/privacy}","received_events_url":"https://api.github.com/users/obsidian-toaster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/obsidian-toaster/generator-backend","description":"The back-end for the Obsidian project generator","fork":false,"url":"https://api.github.com/repos/obsidian-toaster/generator-backend","forks_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/forks","keys_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/teams","hooks_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/hooks","issue_events_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/issues/events{/number}","events_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/events","assignees_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/assignees{/user}","branches_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/branches{/branch}","tags_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/tags","blobs_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/languages","stargazers_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/stargazers","contributors_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/contributors","subscribers_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/subscribers","subscription_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/subscription","commits_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/contents/{+path}","compare_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/merges","archive_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/downloads","issues_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/issues{/number}","pulls_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/labels{/name}","releases_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/releases{/id}","deployments_url":"https://api.github.com/repos/obsidian-toaster/generator-backend/deployments","created_at":"2016-11-03T17:03:59Z","updated_at":"2016-12-06T16:01:12Z","pushed_at":"2017-03-02T14:18:18Z","git_url":"git://github.com/obsidian-toaster/generator-backend.git","ssh_url":"git@github.com:obsidian-toaster/generator-backend.git","clone_url":"https://github.com/obsidian-toaster/generator-backend.git","svn_url":"https://github.com/obsidian-toaster/generator-backend","homepage":"","size":180,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/27"},"html":{"href":"https://github.com/obsidian-toaster/generator-backend/pull/27"},"issue":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/issues/27"},"comments":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/obsidian-toaster/generator-backend/statuses/5d10580995d665b0ae2b02325b58085ad89b8bfc"}}}}
{"actor":{"display_login":"gastaldi"}}