{"action":"created","issue":{"url":"https://api.github.com/repos/nlohmann/json/issues/358","repository_url":"https://api.github.com/repos/nlohmann/json","labels_url":"https://api.github.com/repos/nlohmann/json/issues/358/labels{/name}","comments_url":"https://api.github.com/repos/nlohmann/json/issues/358/comments","events_url":"https://api.github.com/repos/nlohmann/json/issues/358/events","html_url":"https://github.com/nlohmann/json/issues/358","id":188291472,"number":358,"title":"Request: binary serialization/deserialization","user":{"login":"CyberBrainX","id":23361938,"avatar_url":"https://avatars.githubusercontent.com/u/23361938?v=3","gravatar_id":"","url":"https://api.github.com/users/CyberBrainX","html_url":"https://github.com/CyberBrainX","followers_url":"https://api.github.com/users/CyberBrainX/followers","following_url":"https://api.github.com/users/CyberBrainX/following{/other_user}","gists_url":"https://api.github.com/users/CyberBrainX/gists{/gist_id}","starred_url":"https://api.github.com/users/CyberBrainX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyberBrainX/subscriptions","organizations_url":"https://api.github.com/users/CyberBrainX/orgs","repos_url":"https://api.github.com/users/CyberBrainX/repos","events_url":"https://api.github.com/users/CyberBrainX/events{/privacy}","received_events_url":"https://api.github.com/users/CyberBrainX/received_events","type":"User","site_admin":false},"labels":[{"id":46374233,"url":"https://api.github.com/repos/nlohmann/json/labels/kind:%20enhancement/improvement","name":"kind: enhancement/improvement","color":"207de5","default":false},{"id":344572510,"url":"https://api.github.com/repos/nlohmann/json/labels/state:%20help%20needed","name":"state: help needed","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":{"login":"nlohmann","id":159488,"avatar_url":"https://avatars.githubusercontent.com/u/159488?v=3","gravatar_id":"","url":"https://api.github.com/users/nlohmann","html_url":"https://github.com/nlohmann","followers_url":"https://api.github.com/users/nlohmann/followers","following_url":"https://api.github.com/users/nlohmann/following{/other_user}","gists_url":"https://api.github.com/users/nlohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/nlohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlohmann/subscriptions","organizations_url":"https://api.github.com/users/nlohmann/orgs","repos_url":"https://api.github.com/users/nlohmann/repos","events_url":"https://api.github.com/users/nlohmann/events{/privacy}","received_events_url":"https://api.github.com/users/nlohmann/received_events","type":"User","site_admin":false},"assignees":[{"login":"nlohmann","id":159488,"avatar_url":"https://avatars.githubusercontent.com/u/159488?v=3","gravatar_id":"","url":"https://api.github.com/users/nlohmann","html_url":"https://github.com/nlohmann","followers_url":"https://api.github.com/users/nlohmann/followers","following_url":"https://api.github.com/users/nlohmann/following{/other_user}","gists_url":"https://api.github.com/users/nlohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/nlohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlohmann/subscriptions","organizations_url":"https://api.github.com/users/nlohmann/orgs","repos_url":"https://api.github.com/users/nlohmann/repos","events_url":"https://api.github.com/users/nlohmann/events{/privacy}","received_events_url":"https://api.github.com/users/nlohmann/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/nlohmann/json/milestones/14","html_url":"https://github.com/nlohmann/json/milestone/14","labels_url":"https://api.github.com/repos/nlohmann/json/milestones/14/labels","id":2171959,"number":14,"title":"Release 2.0.9","description":"The next release if backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior.","creator":{"login":"nlohmann","id":159488,"avatar_url":"https://avatars.githubusercontent.com/u/159488?v=3","gravatar_id":"","url":"https://api.github.com/users/nlohmann","html_url":"https://github.com/nlohmann","followers_url":"https://api.github.com/users/nlohmann/followers","following_url":"https://api.github.com/users/nlohmann/following{/other_user}","gists_url":"https://api.github.com/users/nlohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/nlohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlohmann/subscriptions","organizations_url":"https://api.github.com/users/nlohmann/orgs","repos_url":"https://api.github.com/users/nlohmann/repos","events_url":"https://api.github.com/users/nlohmann/events{/privacy}","received_events_url":"https://api.github.com/users/nlohmann/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":5,"state":"open","created_at":"2016-12-02T19:10:33Z","updated_at":"2016-12-11T15:37:45Z","due_on":null,"closed_at":null},"comments":28,"created_at":"2016-11-09T16:32:17Z","updated_at":"2016-12-11T15:42:38Z","closed_at":"2016-12-11T15:14:06Z","body":"Wouldn’t it be useful to have the possibility to serialize the json object to a more compact form? \r\nThis would make sense for storing the container or sending it over an internet connection.\r\n\r\nThe  MessagePack (http://msgpack.org/) format or some proprietary format directly derived from your internal representation would be fine. \r\nOr could you probably just provide some generic interface for the binary serialization/deserialization?\r\n\r\nI think this approach could be more useable than just gzipping the whole JSON data.\r\n\r\nAs an example this library did implement some alternative representations of a json container: http://greatpanic.com/progdocs/UniversalContainer.html\r\n(But this library doesn’t work properly and doesn’t use C++ 11)\r\n"},"comment":{"url":"https://api.github.com/repos/nlohmann/json/issues/comments/266289026","html_url":"https://github.com/nlohmann/json/issues/358#issuecomment-266289026","issue_url":"https://api.github.com/repos/nlohmann/json/issues/358","id":266289026,"user":{"login":"marton78","id":1110028,"avatar_url":"https://avatars.githubusercontent.com/u/1110028?v=3","gravatar_id":"","url":"https://api.github.com/users/marton78","html_url":"https://github.com/marton78","followers_url":"https://api.github.com/users/marton78/followers","following_url":"https://api.github.com/users/marton78/following{/other_user}","gists_url":"https://api.github.com/users/marton78/gists{/gist_id}","starred_url":"https://api.github.com/users/marton78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marton78/subscriptions","organizations_url":"https://api.github.com/users/marton78/orgs","repos_url":"https://api.github.com/users/marton78/repos","events_url":"https://api.github.com/users/marton78/events{/privacy}","received_events_url":"https://api.github.com/users/marton78/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T15:42:38Z","updated_at":"2016-12-11T15:42:38Z","body":"Hi @nlohmann, great job! I have looked at your code, some remarks:\r\n\r\n- When converting single / double, you have reimplemented `memcpy`. Why don't you just use it? (or `std::copy`, would be actually even nicer).\r\n- you could `#define` all those magic numbers (or put them in an `enum`)\r\n- msgpack / cbor are so similar that a lot of code is duplicated. probably you could template those conversions based on serialization format (so, two structs: `msgpack` and `cbor`, both of which contain all magic numbers, limits for the integers to fit in the first byte and the conversion functions from small integer to one byte)\r\n\r\nAll in all very nice job, thanks!"}}
{"actor":{"display_login":"marton78"}}