I am using Retrofit 2 for API calls and GSON as converter in my Android project. Converted the json to POJO and followed usual methods which are also used in 50+ API in the same project.
But, is this specific scenario, some of the items are being parsed and assigned to the variable while other's are not.
how to resolve this partial parsing ?
Here you can see difference in Android studio debug vs Postman response
Product.class
public class ProductLookup {
@SerializedName("atsQty")
@Expose
private String atsQty;
@SerializedName("combID")
@Expose
private String combID;
@SerializedName("defaultPickLock")
@Expose
private String defaultPickLock;
@SerializedName("lookupProductPickingLocation")
@Expose
private ArrayList<ProductPickingLocation> productPickingLocations = new ArrayList<>();
@SerializedName("productID")
@Expose
private String productID;
@SerializedName("productName")
@Expose
private String productName;
@SerializedName("totalQty")
@Expose
private String totalQty;
@SerializedName("unitName")
@Expose
private String unitName;
@SerializedName("upc")
@Expose
private String upc;
@SerializedName("vendorName")
@Expose
private String vendorName;
@SerializedName("whName")
@Expose
private String whName;
//getter setters
}
Json response
{
"atsQty": 133,
"combID": 0,
"defaultPickLock": "FA1",
"lookupProductPickingLocation": [
{
"availQty": 22,
"isdefault": true,
"lookupProductBatch": [],
"lookupProductLotSerial": [],
"pickLockID": 26,
"pickingLocationName": "FA1",
"prodPickLockID": 77,
"totalQty": 27
},
{
"availQty": 100,
"isdefault": false,
"lookupProductBatch": [],
"lookupProductLotSerial": [],
"pickLockID": 27,
"pickingLocationName": "FA2",
"prodPickLockID": 121,
"totalQty": 100
},
{
"availQty": 6,
"isdefault": false,
"lookupProductBatch": [],
"lookupProductLotSerial": [],
"pickLockID": 28,
"pickingLocationName": "FB1",
"prodPickLockID": 131,
"totalQty": 6
}
],
"productID": 1065,
"productName": "Arm & Hammer Baking Soda",
"totalQty": 133,
"unitName": "",
"upc": "5454546",
"vendorName": "Vandelay Industries",
"whName": "Warehouse 2"
}