Open mudit-97 opened 3 years ago
I had a requirement to parse this kind of structure: { "animals": [ { "type": "dog", "name": "Fido", "abc": [ "a", "b" ] }, { "type": "cat", "name": "Misse", "abc": [ "a", "b" ] } ] }
I am trying to write a jsonArray inside a jsonArray but ending in errors like:
at <.abc>: wrong type for value; expected string; got []interface {}
My template looks like this: {{range jsonArray (getv "/animals")}} name: {{.name}} type: {{.type}} {{$abc := jsonArray .abc}} {{end}}
I had a requirement to parse this kind of structure: { "animals": [ { "type": "dog", "name": "Fido", "abc": [ "a", "b" ] }, { "type": "cat", "name": "Misse", "abc": [ "a", "b" ] } ] }
I am trying to write a jsonArray inside a jsonArray but ending in errors like:
at <.abc>: wrong type for value; expected string; got []interface {}
My template looks like this: {{range jsonArray (getv "/animals")}} name: {{.name}} type: {{.type}} {{$abc := jsonArray .abc}} {{end}}