Why can we get the error: System.JSONException: Illegal value for primitive?
I intend to parse a JSON response into a custom class. I have used a class and constructor. My motive is to parse the content into the class fields. But I am getting the error that shows: System.JSONException: Illegal value for primitive. Why am I getting such an error?
I suggest you consider making some changes in the Shipments class. You can write down the following line of code:
public Boolean archived; public Boolean updating; Moreover, you can face problems with transit_time and stay_time, which should be integer but may return a string.
If an object has other objects, you need to use inner classes for the present objects, and if you have created an array to out your data, you can use the following code: