{"action":"created","comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments/28965818","id":28965818,"diff_hunk":"@@ -53,12 +65,10 @@ else if(property != null && mediaType.startsWith(\"application/xml\")) {\n       }\n     }\n     else {\n-      for(String key: examples.keySet()) {\n-        String value = examples.get(key);\n-\n-        Map<String, String> kv = new HashMap<String, String>();\n-        kv.put(\"contentType\", key);\n-        kv.put(\"example\", value);\n+      for(Map.Entry<String, Object> entry: examples.entrySet()) {\n+        final Map<String, String> kv = new HashMap<String, String>();\n+        kv.put(\"contentType\", entry.getKey());\n+        kv.put(\"example\", Json.pretty(entry.getValue()));","path":"modules/swagger-codegen/src/main/java/com/wordnik/swagger/codegen/examples/ExampleGenerator.java","position":85,"original_position":85,"commit_id":"9a361746854dc1c177e48433c4a6248b896b682a","original_commit_id":"fc0be6d5035f53d30b5add3dfd027d52d923fb7c","user":{"login":"tomtit","id":11815484,"avatar_url":"https://avatars.githubusercontent.com/u/11815484?v=3","gravatar_id":"","url":"https://api.github.com/users/tomtit","html_url":"https://github.com/tomtit","followers_url":"https://api.github.com/users/tomtit/followers","following_url":"https://api.github.com/users/tomtit/following{/other_user}","gists_url":"https://api.github.com/users/tomtit/gists{/gist_id}","starred_url":"https://api.github.com/users/tomtit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomtit/subscriptions","organizations_url":"https://api.github.com/users/tomtit/orgs","repos_url":"https://api.github.com/users/tomtit/repos","events_url":"https://api.github.com/users/tomtit/events{/privacy}","received_events_url":"https://api.github.com/users/tomtit/received_events","type":"User","site_admin":false},"body":"@wing328, I would like to rework this piece as a part of this PR. I realized the problem with `contentType` after the PR had been created. Perhaps @fehguy or @webron could provide some additional comments here.","created_at":"2015-04-23T14:15:03Z","updated_at":"2015-04-23T14:15:03Z","html_url":"https://github.com/swagger-api/swagger-codegen/pull/676#discussion_r28965818","pull_request_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/676","_links":{"self":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments/28965818"},"html":{"href":"https://github.com/swagger-api/swagger-codegen/pull/676#discussion_r28965818"},"pull_request":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/676"}}},"pull_request":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/676","id":33858396,"html_url":"https://github.com/swagger-api/swagger-codegen/pull/676","diff_url":"https://github.com/swagger-api/swagger-codegen/pull/676.diff","patch_url":"https://github.com/swagger-api/swagger-codegen/pull/676.patch","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/676","number":676,"state":"open","locked":false,"title":"Fixes #646: Example field handling has been fixed.","user":{"login":"tomtit","id":11815484,"avatar_url":"https://avatars.githubusercontent.com/u/11815484?v=3","gravatar_id":"","url":"https://api.github.com/users/tomtit","html_url":"https://github.com/tomtit","followers_url":"https://api.github.com/users/tomtit/followers","following_url":"https://api.github.com/users/tomtit/following{/other_user}","gists_url":"https://api.github.com/users/tomtit/gists{/gist_id}","starred_url":"https://api.github.com/users/tomtit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomtit/subscriptions","organizations_url":"https://api.github.com/users/tomtit/orgs","repos_url":"https://api.github.com/users/tomtit/repos","events_url":"https://api.github.com/users/tomtit/events{/privacy}","received_events_url":"https://api.github.com/users/tomtit/received_events","type":"User","site_admin":false},"body":"Fixes #646: Example field handling has been fixed.\r\nThe swagger-api/swagger-core/pull/1002 has to be accepted first.\r\n\r\nI would suggest to remove escaping of '\\n' (i.e. example = example.replaceAll(\"\\n\", \"\\\\\\\\n\") in [ExampleGenerator](https://github.com/swagger-api/swagger-codegen/pull/676/files#diff-08b7ea6b5aaa485f71bcf31aec901b5dL40) and jsonExample = jsonExample.replaceAll(\"\\\\\\\\n\", \"\\n\") in [NodeJSServerCodegen](https://github.com/swagger-api/swagger-codegen/pull/676/files#diff-7a12f5f8b19af3ab6e9ee4867476611bL181)) and leave this on behalf of particular descendants of the DefaultCodegen class.\r\nAs for now only `html` and `nodejs` generators use examples, while the first outputs examples as is and has the issue reported [here](https://github.com/swagger-api/swagger-codegen/pull/654#issuecomment-93792558), and the former handles escaped '\\n' properly","created_at":"2015-04-22T13:35:47Z","updated_at":"2015-04-23T14:15:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb6c46c1ab97d628847e55bb9f63fa8e3e814e61","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/676/commits","review_comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/676/comments","review_comment_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/676/comments","statuses_url":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/9a361746854dc1c177e48433c4a6248b896b682a","head":{"label":"tomtit:issue646","ref":"issue646","sha":"9a361746854dc1c177e48433c4a6248b896b682a","user":{"login":"tomtit","id":11815484,"avatar_url":"https://avatars.githubusercontent.com/u/11815484?v=3","gravatar_id":"","url":"https://api.github.com/users/tomtit","html_url":"https://github.com/tomtit","followers_url":"https://api.github.com/users/tomtit/followers","following_url":"https://api.github.com/users/tomtit/following{/other_user}","gists_url":"https://api.github.com/users/tomtit/gists{/gist_id}","starred_url":"https://api.github.com/users/tomtit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomtit/subscriptions","organizations_url":"https://api.github.com/users/tomtit/orgs","repos_url":"https://api.github.com/users/tomtit/repos","events_url":"https://api.github.com/users/tomtit/events{/privacy}","received_events_url":"https://api.github.com/users/tomtit/received_events","type":"User","site_admin":false},"repo":{"id":34383029,"name":"swagger-codegen","full_name":"tomtit/swagger-codegen","owner":{"login":"tomtit","id":11815484,"avatar_url":"https://avatars.githubusercontent.com/u/11815484?v=3","gravatar_id":"","url":"https://api.github.com/users/tomtit","html_url":"https://github.com/tomtit","followers_url":"https://api.github.com/users/tomtit/followers","following_url":"https://api.github.com/users/tomtit/following{/other_user}","gists_url":"https://api.github.com/users/tomtit/gists{/gist_id}","starred_url":"https://api.github.com/users/tomtit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomtit/subscriptions","organizations_url":"https://api.github.com/users/tomtit/orgs","repos_url":"https://api.github.com/users/tomtit/repos","events_url":"https://api.github.com/users/tomtit/events{/privacy}","received_events_url":"https://api.github.com/users/tomtit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomtit/swagger-codegen","description":"swagger-codegen contains a template-driven engine to generate client code in different languages by parsing your Swagger Resource Declaration.","fork":true,"url":"https://api.github.com/repos/tomtit/swagger-codegen","forks_url":"https://api.github.com/repos/tomtit/swagger-codegen/forks","keys_url":"https://api.github.com/repos/tomtit/swagger-codegen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomtit/swagger-codegen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomtit/swagger-codegen/teams","hooks_url":"https://api.github.com/repos/tomtit/swagger-codegen/hooks","issue_events_url":"https://api.github.com/repos/tomtit/swagger-codegen/issues/events{/number}","events_url":"https://api.github.com/repos/tomtit/swagger-codegen/events","assignees_url":"https://api.github.com/repos/tomtit/swagger-codegen/assignees{/user}","branches_url":"https://api.github.com/repos/tomtit/swagger-codegen/branches{/branch}","tags_url":"https://api.github.com/repos/tomtit/swagger-codegen/tags","blobs_url":"https://api.github.com/repos/tomtit/swagger-codegen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomtit/swagger-codegen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomtit/swagger-codegen/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomtit/swagger-codegen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomtit/swagger-codegen/statuses/{sha}","languages_url":"https://api.github.com/repos/tomtit/swagger-codegen/languages","stargazers_url":"https://api.github.com/repos/tomtit/swagger-codegen/stargazers","contributors_url":"https://api.github.com/repos/tomtit/swagger-codegen/contributors","subscribers_url":"https://api.github.com/repos/tomtit/swagger-codegen/subscribers","subscription_url":"https://api.github.com/repos/tomtit/swagger-codegen/subscription","commits_url":"https://api.github.com/repos/tomtit/swagger-codegen/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomtit/swagger-codegen/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomtit/swagger-codegen/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomtit/swagger-codegen/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomtit/swagger-codegen/contents/{+path}","compare_url":"https://api.github.com/repos/tomtit/swagger-codegen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomtit/swagger-codegen/merges","archive_url":"https://api.github.com/repos/tomtit/swagger-codegen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomtit/swagger-codegen/downloads","issues_url":"https://api.github.com/repos/tomtit/swagger-codegen/issues{/number}","pulls_url":"https://api.github.com/repos/tomtit/swagger-codegen/pulls{/number}","milestones_url":"https://api.github.com/repos/tomtit/swagger-codegen/milestones{/number}","notifications_url":"https://api.github.com/repos/tomtit/swagger-codegen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomtit/swagger-codegen/labels{/name}","releases_url":"https://api.github.com/repos/tomtit/swagger-codegen/releases{/id}","created_at":"2015-04-22T10:02:34Z","updated_at":"2015-04-22T10:02:35Z","pushed_at":"2015-04-23T08:50:49Z","git_url":"git://github.com/tomtit/swagger-codegen.git","ssh_url":"git@github.com:tomtit/swagger-codegen.git","clone_url":"https://github.com/tomtit/swagger-codegen.git","svn_url":"https://github.com/tomtit/swagger-codegen","homepage":"http://swagger.io","size":16168,"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":"swagger-api:develop_2.0","ref":"develop_2.0","sha":"5c935a4c29aa97443d590a9eabe64e5813fd0ef2","user":{"login":"swagger-api","id":7658037,"avatar_url":"https://avatars.githubusercontent.com/u/7658037?v=3","gravatar_id":"","url":"https://api.github.com/users/swagger-api","html_url":"https://github.com/swagger-api","followers_url":"https://api.github.com/users/swagger-api/followers","following_url":"https://api.github.com/users/swagger-api/following{/other_user}","gists_url":"https://api.github.com/users/swagger-api/gists{/gist_id}","starred_url":"https://api.github.com/users/swagger-api/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagger-api/subscriptions","organizations_url":"https://api.github.com/users/swagger-api/orgs","repos_url":"https://api.github.com/users/swagger-api/repos","events_url":"https://api.github.com/users/swagger-api/events{/privacy}","received_events_url":"https://api.github.com/users/swagger-api/received_events","type":"Organization","site_admin":false},"repo":{"id":2006876,"name":"swagger-codegen","full_name":"swagger-api/swagger-codegen","owner":{"login":"swagger-api","id":7658037,"avatar_url":"https://avatars.githubusercontent.com/u/7658037?v=3","gravatar_id":"","url":"https://api.github.com/users/swagger-api","html_url":"https://github.com/swagger-api","followers_url":"https://api.github.com/users/swagger-api/followers","following_url":"https://api.github.com/users/swagger-api/following{/other_user}","gists_url":"https://api.github.com/users/swagger-api/gists{/gist_id}","starred_url":"https://api.github.com/users/swagger-api/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagger-api/subscriptions","organizations_url":"https://api.github.com/users/swagger-api/orgs","repos_url":"https://api.github.com/users/swagger-api/repos","events_url":"https://api.github.com/users/swagger-api/events{/privacy}","received_events_url":"https://api.github.com/users/swagger-api/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swagger-api/swagger-codegen","description":"swagger-codegen contains a template-driven engine to generate client code in different languages by parsing your Swagger Resource Declaration.","fork":false,"url":"https://api.github.com/repos/swagger-api/swagger-codegen","forks_url":"https://api.github.com/repos/swagger-api/swagger-codegen/forks","keys_url":"https://api.github.com/repos/swagger-api/swagger-codegen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swagger-api/swagger-codegen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swagger-api/swagger-codegen/teams","hooks_url":"https://api.github.com/repos/swagger-api/swagger-codegen/hooks","issue_events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/events{/number}","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/events","assignees_url":"https://api.github.com/repos/swagger-api/swagger-codegen/assignees{/user}","branches_url":"https://api.github.com/repos/swagger-api/swagger-codegen/branches{/branch}","tags_url":"https://api.github.com/repos/swagger-api/swagger-codegen/tags","blobs_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/refs{/sha}","trees_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/{sha}","languages_url":"https://api.github.com/repos/swagger-api/swagger-codegen/languages","stargazers_url":"https://api.github.com/repos/swagger-api/swagger-codegen/stargazers","contributors_url":"https://api.github.com/repos/swagger-api/swagger-codegen/contributors","subscribers_url":"https://api.github.com/repos/swagger-api/swagger-codegen/subscribers","subscription_url":"https://api.github.com/repos/swagger-api/swagger-codegen/subscription","commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/commits{/sha}","git_commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/commits{/sha}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/comments{/number}","issue_comment_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments{/number}","contents_url":"https://api.github.com/repos/swagger-api/swagger-codegen/contents/{+path}","compare_url":"https://api.github.com/repos/swagger-api/swagger-codegen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swagger-api/swagger-codegen/merges","archive_url":"https://api.github.com/repos/swagger-api/swagger-codegen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swagger-api/swagger-codegen/downloads","issues_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues{/number}","pulls_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls{/number}","milestones_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones{/number}","notifications_url":"https://api.github.com/repos/swagger-api/swagger-codegen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels{/name}","releases_url":"https://api.github.com/repos/swagger-api/swagger-codegen/releases{/id}","created_at":"2011-07-06T14:26:48Z","updated_at":"2015-04-23T04:50:30Z","pushed_at":"2015-04-23T10:21:28Z","git_url":"git://github.com/swagger-api/swagger-codegen.git","ssh_url":"git@github.com:swagger-api/swagger-codegen.git","clone_url":"https://github.com/swagger-api/swagger-codegen.git","svn_url":"https://github.com/swagger-api/swagger-codegen","homepage":"http://swagger.io","size":24346,"stargazers_count":791,"watchers_count":791,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":442,"mirror_url":null,"open_issues_count":97,"forks":442,"open_issues":97,"watchers":791,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/676"},"html":{"href":"https://github.com/swagger-api/swagger-codegen/pull/676"},"issue":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/676"},"comments":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/676/comments"},"review_comments":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/676/comments"},"review_comment":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/676/commits"},"statuses":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/9a361746854dc1c177e48433c4a6248b896b682a"}}}}