{"action":"opened","number":12,"pull_request":{"url":"https://api.github.com/repos/apiaryio/sos/pulls/12","id":47221532,"html_url":"https://github.com/apiaryio/sos/pull/12","diff_url":"https://github.com/apiaryio/sos/pull/12.diff","patch_url":"https://github.com/apiaryio/sos/pull/12.patch","issue_url":"https://api.github.com/repos/apiaryio/sos/issues/12","number":12,"state":"open","locked":false,"title":"Don't serialise numbers with scientific notation in JSON","user":{"login":"kylef","id":44164,"avatar_url":"https://avatars.githubusercontent.com/u/44164?v=3","gravatar_id":"","url":"https://api.github.com/users/kylef","html_url":"https://github.com/kylef","followers_url":"https://api.github.com/users/kylef/followers","following_url":"https://api.github.com/users/kylef/following{/other_user}","gists_url":"https://api.github.com/users/kylef/gists{/gist_id}","starred_url":"https://api.github.com/users/kylef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylef/subscriptions","organizations_url":"https://api.github.com/users/kylef/orgs","repos_url":"https://api.github.com/users/kylef/repos","events_url":"https://api.github.com/users/kylef/events{/privacy}","received_events_url":"https://api.github.com/users/kylef/received_events","type":"User","site_admin":false},"body":"This is to fix https://github.com/apiaryio/drafter/issues/140, also to note, scientific notation is allowed in JSON so we don't necessarily need to change the output.\r\n\r\nThis was unfortunately far tricker than I imaged, both the `<<` operator to a stream cannot print a number without trailing precision and scientific notation. There is also no format operator for `snpritnf` to serialise a double to a string as we would like.\r\n\r\nAfter digging around, I think the easiest solution to the problem would be to use the `std::fixed` option with a stream and then strip the trailing precision.\r\n\r\nI'm very welcome to alternative solutions if anyone has any ideas. I've added sufficient comments to the code since this is non-obvious.","created_at":"2015-10-09T00:05:41Z","updated_at":"2015-10-09T00:05:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apiaryio/sos/pulls/12/commits","review_comments_url":"https://api.github.com/repos/apiaryio/sos/pulls/12/comments","review_comment_url":"https://api.github.com/repos/apiaryio/sos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apiaryio/sos/issues/12/comments","statuses_url":"https://api.github.com/repos/apiaryio/sos/statuses/3bfe38d48cc0cf2e12ee8dd15cc534a5c6912066","head":{"label":"apiaryio:kylef/json-science","ref":"kylef/json-science","sha":"3bfe38d48cc0cf2e12ee8dd15cc534a5c6912066","user":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"repo":{"id":29012306,"name":"sos","full_name":"apiaryio/sos","owner":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apiaryio/sos","description":"Simple c++ Object Serialization","fork":false,"url":"https://api.github.com/repos/apiaryio/sos","forks_url":"https://api.github.com/repos/apiaryio/sos/forks","keys_url":"https://api.github.com/repos/apiaryio/sos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiaryio/sos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiaryio/sos/teams","hooks_url":"https://api.github.com/repos/apiaryio/sos/hooks","issue_events_url":"https://api.github.com/repos/apiaryio/sos/issues/events{/number}","events_url":"https://api.github.com/repos/apiaryio/sos/events","assignees_url":"https://api.github.com/repos/apiaryio/sos/assignees{/user}","branches_url":"https://api.github.com/repos/apiaryio/sos/branches{/branch}","tags_url":"https://api.github.com/repos/apiaryio/sos/tags","blobs_url":"https://api.github.com/repos/apiaryio/sos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiaryio/sos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiaryio/sos/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiaryio/sos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiaryio/sos/statuses/{sha}","languages_url":"https://api.github.com/repos/apiaryio/sos/languages","stargazers_url":"https://api.github.com/repos/apiaryio/sos/stargazers","contributors_url":"https://api.github.com/repos/apiaryio/sos/contributors","subscribers_url":"https://api.github.com/repos/apiaryio/sos/subscribers","subscription_url":"https://api.github.com/repos/apiaryio/sos/subscription","commits_url":"https://api.github.com/repos/apiaryio/sos/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiaryio/sos/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiaryio/sos/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiaryio/sos/issues/comments{/number}","contents_url":"https://api.github.com/repos/apiaryio/sos/contents/{+path}","compare_url":"https://api.github.com/repos/apiaryio/sos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiaryio/sos/merges","archive_url":"https://api.github.com/repos/apiaryio/sos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiaryio/sos/downloads","issues_url":"https://api.github.com/repos/apiaryio/sos/issues{/number}","pulls_url":"https://api.github.com/repos/apiaryio/sos/pulls{/number}","milestones_url":"https://api.github.com/repos/apiaryio/sos/milestones{/number}","notifications_url":"https://api.github.com/repos/apiaryio/sos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiaryio/sos/labels{/name}","releases_url":"https://api.github.com/repos/apiaryio/sos/releases{/id}","created_at":"2015-01-09T10:41:44Z","updated_at":"2015-02-27T14:52:53Z","pushed_at":"2015-10-09T00:00:18Z","git_url":"git://github.com/apiaryio/sos.git","ssh_url":"git@github.com:apiaryio/sos.git","clone_url":"https://github.com/apiaryio/sos.git","svn_url":"https://github.com/apiaryio/sos","homepage":null,"size":281,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"apiaryio:master","ref":"master","sha":"ff10960a4f1bda85dabff4a794e4d3910311ae17","user":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"repo":{"id":29012306,"name":"sos","full_name":"apiaryio/sos","owner":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apiaryio/sos","description":"Simple c++ Object Serialization","fork":false,"url":"https://api.github.com/repos/apiaryio/sos","forks_url":"https://api.github.com/repos/apiaryio/sos/forks","keys_url":"https://api.github.com/repos/apiaryio/sos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiaryio/sos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiaryio/sos/teams","hooks_url":"https://api.github.com/repos/apiaryio/sos/hooks","issue_events_url":"https://api.github.com/repos/apiaryio/sos/issues/events{/number}","events_url":"https://api.github.com/repos/apiaryio/sos/events","assignees_url":"https://api.github.com/repos/apiaryio/sos/assignees{/user}","branches_url":"https://api.github.com/repos/apiaryio/sos/branches{/branch}","tags_url":"https://api.github.com/repos/apiaryio/sos/tags","blobs_url":"https://api.github.com/repos/apiaryio/sos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiaryio/sos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiaryio/sos/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiaryio/sos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiaryio/sos/statuses/{sha}","languages_url":"https://api.github.com/repos/apiaryio/sos/languages","stargazers_url":"https://api.github.com/repos/apiaryio/sos/stargazers","contributors_url":"https://api.github.com/repos/apiaryio/sos/contributors","subscribers_url":"https://api.github.com/repos/apiaryio/sos/subscribers","subscription_url":"https://api.github.com/repos/apiaryio/sos/subscription","commits_url":"https://api.github.com/repos/apiaryio/sos/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiaryio/sos/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiaryio/sos/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiaryio/sos/issues/comments{/number}","contents_url":"https://api.github.com/repos/apiaryio/sos/contents/{+path}","compare_url":"https://api.github.com/repos/apiaryio/sos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiaryio/sos/merges","archive_url":"https://api.github.com/repos/apiaryio/sos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiaryio/sos/downloads","issues_url":"https://api.github.com/repos/apiaryio/sos/issues{/number}","pulls_url":"https://api.github.com/repos/apiaryio/sos/pulls{/number}","milestones_url":"https://api.github.com/repos/apiaryio/sos/milestones{/number}","notifications_url":"https://api.github.com/repos/apiaryio/sos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiaryio/sos/labels{/name}","releases_url":"https://api.github.com/repos/apiaryio/sos/releases{/id}","created_at":"2015-01-09T10:41:44Z","updated_at":"2015-02-27T14:52:53Z","pushed_at":"2015-10-09T00:00:18Z","git_url":"git://github.com/apiaryio/sos.git","ssh_url":"git@github.com:apiaryio/sos.git","clone_url":"https://github.com/apiaryio/sos.git","svn_url":"https://github.com/apiaryio/sos","homepage":null,"size":281,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apiaryio/sos/pulls/12"},"html":{"href":"https://github.com/apiaryio/sos/pull/12"},"issue":{"href":"https://api.github.com/repos/apiaryio/sos/issues/12"},"comments":{"href":"https://api.github.com/repos/apiaryio/sos/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/apiaryio/sos/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/apiaryio/sos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apiaryio/sos/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/apiaryio/sos/statuses/3bfe38d48cc0cf2e12ee8dd15cc534a5c6912066"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":33,"deletions":2,"changed_files":3}}