{"action":"created","issue":{"url":"https://api.github.com/repos/BlackEdder/painlessjson/issues/36","labels_url":"https://api.github.com/repos/BlackEdder/painlessjson/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/BlackEdder/painlessjson/issues/36/comments","events_url":"https://api.github.com/repos/BlackEdder/painlessjson/issues/36/events","html_url":"https://github.com/BlackEdder/painlessjson/issues/36","id":65952450,"number":36,"title":"From Json not creating nested array of struct","user":{"login":"kingsleyh","id":103770,"avatar_url":"https://avatars.githubusercontent.com/u/103770?v=3","gravatar_id":"","url":"https://api.github.com/users/kingsleyh","html_url":"https://github.com/kingsleyh","followers_url":"https://api.github.com/users/kingsleyh/followers","following_url":"https://api.github.com/users/kingsleyh/following{/other_user}","gists_url":"https://api.github.com/users/kingsleyh/gists{/gist_id}","starred_url":"https://api.github.com/users/kingsleyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kingsleyh/subscriptions","organizations_url":"https://api.github.com/users/kingsleyh/orgs","repos_url":"https://api.github.com/users/kingsleyh/repos","events_url":"https://api.github.com/users/kingsleyh/events{/privacy}","received_events_url":"https://api.github.com/users/kingsleyh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-02T15:31:55Z","updated_at":"2015-04-02T18:37:40Z","closed_at":null,"body":"Hi - am I doing something wrong here?\r\n\r\n    import std.json;\r\n    import painlessjson;\r\n    import std.array;\r\n\r\n\r\n     struct Label{\r\n     \tstring name;\r\n      }\r\n\r\n      struct Scenario{\r\n     \tstring name;\r\n     \tLabel[] labels;\r\n      }\r\n\r\n      Scenario[] scenarios = fromJSON!(Scenario[])(parseJSON(q{[{\"name\":\"scenario1\",\"labels\":   [{\"name\":\"label1\"}]}]}));\r\n     writeln(scenarios.front.labels);\r\n\r\n> Running unit tests\r\n[]\r\n\r\nscenarios should have a list of labels - but its empty. \r\nWhen I change Label[] labels to JSONValue labels and print it out I get this:\r\n\r\n> Running unit tests\r\n[{\"name\":\"label1\"}]\r\n\r\nso it looks like its finding the json ok - just not turning it into a Label[] "},"comment":{"url":"https://api.github.com/repos/BlackEdder/painlessjson/issues/comments/89004541","html_url":"https://github.com/BlackEdder/painlessjson/issues/36#issuecomment-89004541","issue_url":"https://api.github.com/repos/BlackEdder/painlessjson/issues/36","id":89004541,"user":{"login":"kingsleyh","id":103770,"avatar_url":"https://avatars.githubusercontent.com/u/103770?v=3","gravatar_id":"","url":"https://api.github.com/users/kingsleyh","html_url":"https://github.com/kingsleyh","followers_url":"https://api.github.com/users/kingsleyh/followers","following_url":"https://api.github.com/users/kingsleyh/following{/other_user}","gists_url":"https://api.github.com/users/kingsleyh/gists{/gist_id}","starred_url":"https://api.github.com/users/kingsleyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kingsleyh/subscriptions","organizations_url":"https://api.github.com/users/kingsleyh/orgs","repos_url":"https://api.github.com/users/kingsleyh/repos","events_url":"https://api.github.com/users/kingsleyh/events{/privacy}","received_events_url":"https://api.github.com/users/kingsleyh/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T18:37:40Z","updated_at":"2015-04-02T18:37:40Z","body":"How is this test passing in your repo - it looks very similar to what in trying to do:\r\n\r\n/// Array as member of other class\r\nunittest\r\n{\r\n    // Types need to be defined in different module, otherwise \r\n    // type is not known at compile time\r\n    import painlessjson.unittesttypes_local_import;\r\n\r\n    string jsonString = q{[ {\"duration\": \"10\"} ]};\r\n    Route[] routes = parseJSON(jsonString).fromJSON!(Route[]);\r\n    assertEqual(routes.length, 1);\r\n\r\n    jsonString = q{{\"routes\":[ {\"duration\": \"10\"} ] }};\r\n    JourneyPlan jp;\r\n    jp = parseJSON(jsonString).fromJSON!JourneyPlan;\r\n    assertEqual(jp.routes.length, 1);\r\n}\r\n"}}