On Thu, 31 Mar 2016 17:18:16 GMT, John More wrote:
I have the following JSON
[{"id":"1234","value":"20","name":"PowerSave"},{"id":"4567","value":"680","name":"PowerNormal"}]I want to deserialize into the following
struct theData { string id; string value; string name; }
I have tried
theData theResposne= deserializeJson!theData(res.bodyReader.readAllUTF8()); theData[] theResposne= deserializeJson!theData(res.bodyReader.readAllUTF8());
and many other variants to no avail.
Suggestions appreciated.Thanks
This should work:
auto theResponse = deserializeJson!(theData[])(res.bodyReader.readAllUTF8());
In the last line you were just missing the []
for the template argument.