Handle error converting {null} to type system.Int32 in input json
Another option is to ignore null values.
JsonConvert.DeserializeObject<YourType>(jsonText, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
You could use replace your Int32
s with their nullable counterpart using int?
. You can find more about nullable types here.