Hello everyone I have some trouble to deserialize my json with Gson. I expose my problem to you via a simple example :
This is the JSON that I receive :
"order": {
"id": "123",
"name": "BOBI",
"items": {
"totalSize": 2,
"records": [
{
"id": "456",
"Quantity": 1.0,
"Description": "Shipping",
"TotalAmount": 6.29,
"TotalTaxAmount": 0.3,
"UnitPrice": 5.99
}
]
}
}
I would like to delete/skip this useless part :
"totalSize": 2,
"records": [
I need a functionality like @SerializedName("items.records") to skip a level by using a Java class like this below :
public class SFOrderDto {
private String id;
private String name;
@SerializedName("items.records")
private List<SFProductDto> records;
}
The main call :
SFOrderDto orderArray = gson.fromJson(jsonOrder, SFOrderDto.class);
Hope somebody can help me and sorry for my bad english ! :)