I am facing issue with parsing jsonArray below
{
"name": [
{
"actions": "test",
"Items": [
{
"Components": [
{
"details": {
"label": "Name"
}
}]
},...
{
"Components": [
{
"details": {
"label": "Name"
}
}]
}]
}]
}
I have written a wrapper class as well as below
public class Name{
public String actions{get; set;}
public Item items{get; set;}
public class Item{
public Component components {get; set;}
}
public class Component{
public detail details {get; set;}
}
public class detail{
public String label {get; set;}
}
public static Name parse(String json){
return (Name) System.JSON.deserialize(json,
Name.class);
}
}
whenever I am trying to do
System.debug(name.items[0].components[0].details.label);
I am getting the label value but what should i do if there are many values in "Items", "componemts"?
Do I have to iterate over all the arrays?
Is there any way without using looping 2 times?