{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-js/issues/627","labels_url":"https://api.github.com/repos/swagger-api/swagger-js/issues/627/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-js/issues/627/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-js/issues/627/events","html_url":"https://github.com/swagger-api/swagger-js/pull/627","id":115873891,"number":627,"title":"Output curl --data in single quotes (instead of double quotes)","user":{"login":"kwizzn","id":119017,"avatar_url":"https://avatars.githubusercontent.com/u/119017?v=3","gravatar_id":"","url":"https://api.github.com/users/kwizzn","html_url":"https://github.com/kwizzn","followers_url":"https://api.github.com/users/kwizzn/followers","following_url":"https://api.github.com/users/kwizzn/following{/other_user}","gists_url":"https://api.github.com/users/kwizzn/gists{/gist_id}","starred_url":"https://api.github.com/users/kwizzn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwizzn/subscriptions","organizations_url":"https://api.github.com/users/kwizzn/orgs","repos_url":"https://api.github.com/users/kwizzn/repos","events_url":"https://api.github.com/users/kwizzn/events{/privacy}","received_events_url":"https://api.github.com/users/kwizzn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-11-09T13:14:30Z","updated_at":"2015-11-17T14:02:22Z","closed_at":"2015-11-16T15:40:33Z","pull_request":{"url":"https://api.github.com/repos/swagger-api/swagger-js/pulls/627","html_url":"https://github.com/swagger-api/swagger-js/pull/627","diff_url":"https://github.com/swagger-api/swagger-js/pull/627.diff","patch_url":"https://github.com/swagger-api/swagger-js/pull/627.patch"},"body":"We have a scenario where we have a \"!\" character inside our JSON request data:\r\n```\r\n{\r\n  \"username\": \"alice\",\r\n  \"password\": \"cooper!00\"\r\n}\r\n```\r\n\r\nSwagger's `asCurl` method renders this as follows:\r\n\r\n```\r\ncurl -X POST -d \"{\r\n  \\\"username\\\": \\\"alice\\\",\r\n  \\\"password\\\": \\\"cooper!00\\\"\r\n}\" https://example.com/api\r\n```\r\n\r\nbash now tries to interpret the \"!\" here, which results in this error: `-bash: !00: event not found`.\r\n\r\nThere's no way to escape \"!\" in double quotes so we suggest the following output:\r\n\r\n```\r\ncurl -X POST -d '{\r\n  \"username\": \"alice\",\r\n  \"password\": \"cooper!00\"\r\n}' https://example.com/api\r\n```\r\n\r\nDoes the trick and is also much easier to read.\r\n\r\nWould you accept this PR? It fixes the problem and updates the corresponding 2 tests."},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-js/issues/comments/157377526","html_url":"https://github.com/swagger-api/swagger-js/pull/627#issuecomment-157377526","issue_url":"https://api.github.com/repos/swagger-api/swagger-js/issues/627","id":157377526,"user":{"login":"kwizzn","id":119017,"avatar_url":"https://avatars.githubusercontent.com/u/119017?v=3","gravatar_id":"","url":"https://api.github.com/users/kwizzn","html_url":"https://github.com/kwizzn","followers_url":"https://api.github.com/users/kwizzn/followers","following_url":"https://api.github.com/users/kwizzn/following{/other_user}","gists_url":"https://api.github.com/users/kwizzn/gists{/gist_id}","starred_url":"https://api.github.com/users/kwizzn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwizzn/subscriptions","organizations_url":"https://api.github.com/users/kwizzn/orgs","repos_url":"https://api.github.com/users/kwizzn/repos","events_url":"https://api.github.com/users/kwizzn/events{/privacy}","received_events_url":"https://api.github.com/users/kwizzn/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T14:02:22Z","updated_at":"2015-11-17T14:02:22Z","body":"Happy to do it as soon as possible."}}