Help on asdf json module

Vino akashvino79 at
Sun Oct 25 06:05:27 UTC 2020

Hi All,

    Currently we are testing various json module such as 
"std.json, std_data_json, and asdf", the below 
code works perfectely while use  "std_data_json or" but not working as expected when we use "asdf" 
and throwing the below error, hence request your help on the same.


source/app.d(12,2): Error: invalid foreach aggregate 
jv.opIndex(["items"][]), define opApply(), range primitives, or 
use .tupleof


import std.stdio: writeln;
import;           // works
//import asdf;                   // Does not work.
import std.conv: to;

void main()
  string apidata = 
`{"items":[{"name":"T10","hostname":"test1","type":[{"typeValue":"TD,dev at,DEVt"},{"typeno":"000"}]},{"name":"T11","hostname":"test2","type":[{"typeValue":"TF,qas at,QAS"},{"typeno":"100"}]},{"name":"T11","hostname":"test3","type":[{"typeValue":"TP,prd at,PRD"},{"typeno":"101"}]}]}`;
  auto jv = parseJson(apidata);
  foreach(j; jv["items"]){


More information about the Digitalmars-d-learn mailing list