GitHub PullRequestReviewCommentEvent at 2014-12-10 16:04:33
Repository: elasticsearch
Actor: rjernst
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/21612808","id":21612808,"diff_hunk":"@@ -146,4 +147,38 @@ public void simpleGetFieldMappingsWithDefaults() throws Exception {\n \n \n     }\n+\n+    //fix #6552\n+    @Test\n+    public void simpleGetFieldMappingsWithPretty() throws Exception {\n+        assertAcked(prepareCreate(\"index\").addMapping(\"type\", getMappingForType(\"type\")));\n+        Map<String, String> params = Maps.newHashMap();\n+        params.put(\"pretty\", \"true\");\n+        ensureYellow();\n+        GetFieldMappingsResponse response = client().admin().indices().prepareGetFieldMappings(\"index\").setTypes(\"type\").setFields(\"field1\", \"obj.subfield\").get();\n+        XContentBuilder responseBuilder = XContentFactory.jsonBuilder().prettyPrint();\n+        responseBuilder.startObject();\n+        response.toXContent(responseBuilder, new ToXContent.MapParams(params));\n+        responseBuilder.endObject();\n+        String responseStrings = responseBuilder.string();\n+\n+\n+        XContentBuilder prettyJsonBuilder = XContentFactory.jsonBuilder().prettyPrint();\n+        prettyJsonBuilder.copyCurrentStructure(XContentFactory.xContent(responseStrings).createParser(responseStrings));\n+        assertThat(responseStrings, equalTo(prettyJsonBuilder.string()));\n+\n+        params.put(\"pretty\", \"false\");\n+\n+        response = client().admin().indices().prepareGetFieldMappings(\"index\").setTypes(\"type\").setFields(\"field1\",\"obj.subfield\").get();\n+        responseBuilder = XContentFactory.jsonBuilder().prettyPrint().lfAtEnd();\n+        responseBuilder.startObject();\n+        response.toXContent(responseBuilder, new ToXContent.MapParams(params));\n+        responseBuilder.endObject();\n+        responseStrings = responseBuilder.string();\n+\n+        prettyJsonBuilder = XContentFactory.jsonBuilder().prettyPrint();\n+        prettyJsonBuilder.copyCurrentStructure(XContentFactory.xContent(responseStrings).createParser(responseStrings));\n+        assertThat(responseStrings,not(equalTo(prettyJsonBuilder.string())));","path":"src/test/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsTests.java","position":46,"original_position":46,"commit_id":"4ea593e1c0023ef30c7d02f527c8d87dca206ba4","original_commit_id":"4ea593e1c0023ef30c7d02f527c8d87dca206ba4","user":{"login":"rjernst","id":289412,"avatar_url":"https://avatars.githubusercontent.com/u/289412?v=3","gravatar_id":"","url":"https://api.github.com/users/rjernst","html_url":"https://github.com/rjernst","followers_url":"https://api.github.com/users/rjernst/followers","following_url":"https://api.github.com/users/rjernst/following{/other_user}","gists_url":"https://api.github.com/users/rjernst/gists{/gist_id}","starred_url":"https://api.github.com/users/rjernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjernst/subscriptions","organizations_url":"https://api.github.com/users/rjernst/orgs","repos_url":"https://api.github.com/users/rjernst/repos","events_url":"https://api.github.com/users/rjernst/events{/privacy}","received_events_url":"https://api.github.com/users/rjernst/received_events","type":"User","site_admin":false},"body":"Shouldn't this be equal to the `jsonBuilder().string()` above, without adding `.prettyPrint()`? And a nitpick: please add a space after the comma..","created_at":"2014-12-10T16:04:33Z","updated_at":"2014-12-10T16:04:33Z","html_url":"https://github.com/elasticsearch/elasticsearch/pull/8806#discussion_r21612808","pull_request_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8806","_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/21612808"},"html":{"href":"https://github.com/elasticsearch/elasticsearch/pull/8806#discussion_r21612808"},"pull_request":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8806"}}},"pull_request":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8806","id":25632727,"html_url":"https://github.com/elasticsearch/elasticsearch/pull/8806","diff_url":"https://github.com/elasticsearch/elasticsearch/pull/8806.diff","patch_url":"https://github.com/elasticsearch/elasticsearch/pull/8806.patch","issue_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/8806","number":8806,"state":"open","locked":false,"title":"Mappings: Fix Get field mapping api with pretty flag","user":{"login":"johtani","id":1142449,"avatar_url":"https://avatars.githubusercontent.com/u/1142449?v=3","gravatar_id":"","url":"https://api.github.com/users/johtani","html_url":"https://github.com/johtani","followers_url":"https://api.github.com/users/johtani/followers","following_url":"https://api.github.com/users/johtani/following{/other_user}","gists_url":"https://api.github.com/users/johtani/gists{/gist_id}","starred_url":"https://api.github.com/users/johtani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johtani/subscriptions","organizations_url":"https://api.github.com/users/johtani/orgs","repos_url":"https://api.github.com/users/johtani/repos","events_url":"https://api.github.com/users/johtani/events{/privacy}","received_events_url":"https://api.github.com/users/johtani/received_events","type":"User","site_admin":false},"body":"Use  builder.field method instead of XContentHelper#writeRawField\r\n\r\nCloses #6552","created_at":"2014-12-07T14:38:35Z","updated_at":"2014-12-10T16:04:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a68832c4c524e1c66ab11185bb4e818f9695f703","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8806/commits","review_comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8806/comments","review_comment_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/{number}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/8806/comments","statuses_url":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/4ea593e1c0023ef30c7d02f527c8d87dca206ba4","head":{"label":"johtani:fix/pretty_get_field_mapping","ref":"fix/pretty_get_field_mapping","sha":"4ea593e1c0023ef30c7d02f527c8d87dca206ba4","user":{"login":"johtani","id":1142449,"avatar_url":"https://avatars.githubusercontent.com/u/1142449?v=3","gravatar_id":"","url":"https://api.github.com/users/johtani","html_url":"https://github.com/johtani","followers_url":"https://api.github.com/users/johtani/followers","following_url":"https://api.github.com/users/johtani/following{/other_user}","gists_url":"https://api.github.com/users/johtani/gists{/gist_id}","starred_url":"https://api.github.com/users/johtani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johtani/subscriptions","organizations_url":"https://api.github.com/users/johtani/orgs","repos_url":"https://api.github.com/users/johtani/repos","events_url":"https://api.github.com/users/johtani/events{/privacy}","received_events_url":"https://api.github.com/users/johtani/received_events","type":"User","site_admin":false},"repo":{"id":12916853,"name":"elasticsearch","full_name":"johtani/elasticsearch","owner":{"login":"johtani","id":1142449,"avatar_url":"https://avatars.githubusercontent.com/u/1142449?v=3","gravatar_id":"","url":"https://api.github.com/users/johtani","html_url":"https://github.com/johtani","followers_url":"https://api.github.com/users/johtani/followers","following_url":"https://api.github.com/users/johtani/following{/other_user}","gists_url":"https://api.github.com/users/johtani/gists{/gist_id}","starred_url":"https://api.github.com/users/johtani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johtani/subscriptions","organizations_url":"https://api.github.com/users/johtani/orgs","repos_url":"https://api.github.com/users/johtani/repos","events_url":"https://api.github.com/users/johtani/events{/privacy}","received_events_url":"https://api.github.com/users/johtani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/johtani/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/johtani/elasticsearch","forks_url":"https://api.github.com/repos/johtani/elasticsearch/forks","keys_url":"https://api.github.com/repos/johtani/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/johtani/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/johtani/elasticsearch/teams","hooks_url":"https://api.github.com/repos/johtani/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/johtani/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/johtani/elasticsearch/events","assignees_url":"https://api.github.com/repos/johtani/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/johtani/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/johtani/elasticsearch/tags","blobs_url":"https://api.github.com/repos/johtani/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/johtani/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/johtani/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/johtani/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/johtani/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/johtani/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/johtani/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/johtani/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/johtani/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/johtani/elasticsearch/subscription","commits_url":"https://api.github.com/repos/johtani/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/johtani/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/johtani/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/johtani/elasticsearch/issues/comments/{number}","contents_url":"https://api.github.com/repos/johtani/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/johtani/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/johtani/elasticsearch/merges","archive_url":"https://api.github.com/repos/johtani/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/johtani/elasticsearch/downloads","issues_url":"https://api.github.com/repos/johtani/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/johtani/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/johtani/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/johtani/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/johtani/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/johtani/elasticsearch/releases{/id}","created_at":"2013-09-18T07:31:27Z","updated_at":"2014-07-02T06:17:57Z","pushed_at":"2014-12-09T10:12:57Z","git_url":"git://github.com/johtani/elasticsearch.git","ssh_url":"git@github.com:johtani/elasticsearch.git","clone_url":"https://github.com/johtani/elasticsearch.git","svn_url":"https://github.com/johtani/elasticsearch","homepage":"http://elasticsearch.org","size":73322,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"elasticsearch:master","ref":"master","sha":"3cdf266d4dad8e4d87c1d98cd148b92616b06a53","user":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elasticsearch/elasticsearch","owner":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elasticsearch/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elasticsearch/elasticsearch","forks_url":"https://api.github.com/repos/elasticsearch/elasticsearch/forks","keys_url":"https://api.github.com/repos/elasticsearch/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elasticsearch/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elasticsearch/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elasticsearch/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elasticsearch/elasticsearch/events","assignees_url":"https://api.github.com/repos/elasticsearch/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elasticsearch/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elasticsearch/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elasticsearch/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elasticsearch/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elasticsearch/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elasticsearch/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elasticsearch/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/comments/{number}","contents_url":"https://api.github.com/repos/elasticsearch/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elasticsearch/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elasticsearch/elasticsearch/merges","archive_url":"https://api.github.com/repos/elasticsearch/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elasticsearch/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elasticsearch/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elasticsearch/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elasticsearch/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elasticsearch/elasticsearch/releases{/id}","created_at":"2010-02-08T13:20:56Z","updated_at":"2014-12-10T15:58:36Z","pushed_at":"2014-12-10T15:58:35Z","git_url":"git://github.com/elasticsearch/elasticsearch.git","ssh_url":"git@github.com:elasticsearch/elasticsearch.git","clone_url":"https://github.com/elasticsearch/elasticsearch.git","svn_url":"https://github.com/elasticsearch/elasticsearch","homepage":"http://elasticsearch.org","size":251974,"stargazers_count":9200,"watchers_count":9200,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2793,"mirror_url":null,"open_issues_count":938,"forks":2793,"open_issues":938,"watchers":9200,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8806"},"html":{"href":"https://github.com/elasticsearch/elasticsearch/pull/8806"},"issue":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/8806"},"comments":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/8806/comments"},"review_comments":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8806/comments"},"review_comment":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8806/commits"},"statuses":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/4ea593e1c0023ef30c7d02f527c8d87dca206ba4"}}}}