{"action":"closed","issue":{"url":"https://api.github.com/repos/jgaa/restc-cpp/issues/64","repository_url":"https://api.github.com/repos/jgaa/restc-cpp","labels_url":"https://api.github.com/repos/jgaa/restc-cpp/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/jgaa/restc-cpp/issues/64/comments","events_url":"https://api.github.com/repos/jgaa/restc-cpp/issues/64/events","html_url":"https://github.com/jgaa/restc-cpp/issues/64","id":324540168,"node_id":"MDU6SXNzdWUzMjQ1NDAxNjg=","number":64,"title":"Handle nested JSON Arrays in deserialization","user":{"login":"gdfast","id":15788720,"node_id":"MDQ6VXNlcjE1Nzg4NzIw","avatar_url":"https://avatars0.githubusercontent.com/u/15788720?v=4","gravatar_id":"","url":"https://api.github.com/users/gdfast","html_url":"https://github.com/gdfast","followers_url":"https://api.github.com/users/gdfast/followers","following_url":"https://api.github.com/users/gdfast/following{/other_user}","gists_url":"https://api.github.com/users/gdfast/gists{/gist_id}","starred_url":"https://api.github.com/users/gdfast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdfast/subscriptions","organizations_url":"https://api.github.com/users/gdfast/orgs","repos_url":"https://api.github.com/users/gdfast/repos","events_url":"https://api.github.com/users/gdfast/events{/privacy}","received_events_url":"https://api.github.com/users/gdfast/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-18T20:21:11Z","updated_at":"2018-08-27T10:30:47Z","closed_at":"2018-08-27T10:30:47Z","author_association":"NONE","body":"Deserializing nested JSON arrays seems to not be supported right now, although nested arrays are valid JSON.\r\n\r\nAn example would be the results of an influxdb query (particularly the `values` object):\r\n\r\n```json\r\n{\"results\":[{\"statement_id\":0,\"series\":[{\"name\":\"mymeas\",\"columns\":[\"time\",\"myfield\",\"mytag1\",\"mytag2\"],\"values\":[[\"2017-03-01T00:16:18Z\",33.1,null,null],[\"2017-03-01T00:17:18Z\",12.4,\"12\",\"14\"]]}]}]}\r\n```\r\n\r\nI added a unit test in restc-cpp/tests/unit/JsonSerializeTests.cpp to demonstrate the issue\r\n\r\n```cpp\r\nSTARTCASE(DeserializeNestedArray) {\r\n    std::string json = R\"([[1, 2, 3],[4, 5, 6]])\";\r\n\r\n    std::vector<std::vector<int>> nested_ints;\r\n    RapidJsonDeserializer<decltype(nested_ints)> handler(nested_ints);\r\n    Reader reader;\r\n    StringStream ss(json.c_str());\r\n    reader.Parse(ss, handler);\r\n\r\n    CHECK_EQUAL(2, static_cast<int>(nested_ints.size()));\r\n\r\n    for(int i = 0; i < 2; ++i) {\r\n        CHECK_EQUAL(3, static_cast<int>(nested_ints[i].size()));\r\n\r\n        for(int j = 0; j < 3; ++j) {\r\n            CHECK_EQUAL(i * 3 + j + 1, nested_ints[i][j]);\r\n        }\r\n    }\r\n} ENDCASE\r\n```\r\n\r\n```\r\n[2018-05-18 14:38:51.296883] [0x000007f4d80da188] [debug]   ================================\r\n[2018-05-18 14:38:51.296891] [0x000007f4d80da188] [info]    Test case: DeserializeNestedArray\r\n[2018-05-18 14:38:51.296897] [0x000007f4d80da188] [debug]   ================================\r\njson_serialize_tests: restc-cpp/include/restc-cpp/SerializeJson.h:1079: bool restc_cpp::RapidJsonDeserializer<T>::DoStartArray() [with T = std::vector<std::vector<int> >]: Assertion `false' failed.\r\nAborted (core dumped)\r\n```\r\n"}}
{"actor":{"display_login":"jgaa"}}