Below is my JSON and I want it to parse and display the contents in a table in LWC like below. I used the JSONtoApex tool to create the parser class but I am not getting in which format I should return my data to LWC jS file so that I can iterate the list/array and display the data in the format shown in below image? I am able to add the individual inner JSON elements (identity,policy..) in to list but I want them to be in a single datatype to be able to iterate in js
ResultDataJsonParse obj = ResultDataJsonParse.parse(responseBody);
List<ResultDataJsonParse.detail> detailsList = new List<ResultDataJsonParse.detail>();
List<ResultDataJsonParse.contract> contractsList = new List<ResultDataJsonParse.contract>();
for(ResultDataJsonParse.content con:obj.content ){
detailsList.add(con.vehicle);
}
{
"content": [
{
"identity": {
"caseId": "7546040",
"caseType": "SMR"
},
"policy": {
"createDate": "1669620011000",
"modifyDate": "1670398216000",
"statusCode": "NI"
},
"customer": {
"customerId": "865208",
"name": "KE PROTEZIONI SOLARI S.R.L."
},
"vehicle": {
"registrationNumber": "FX446DX",
"vehicleId": "AAFN3045"
}
},
{
"identity": {
"caseId": "7546040",
"caseType": "SMR"
},
"policy": {
"createDate": "1669620011000",
"modifyDate": "1670398216000",
"statusCode": "NI"
},
"customer": {
"customerId": "865208",
"name": "KE PROTEZIONI SOLARI S.R.L."
},
"vehicle": {
"registrationNumber": "FX446DX",
"vehicleId": "AAFN3045"
}
}
],
"first": "true",
"numberOfElements": "22"
}