The structure of the JSON response is in the format
Dictionary<string,Dictionary<string,double>>
which is to be deserialized.
Sometimes the inner dictionary is received as empty , {} which throws an error
Error converting value \"{}\" to type 'System.Collections.Generic.Dictionary`2[System.String,System.Double]'. Path '513215', line 1, position 14.
Even on trying below piece of code : it gives the same error
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Ignore
};
var json_response = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, double>>>(response, settings);
How to handle this error and what are the best practices to handle it?
Example JSON which causes error

Dictionary<string,Dictionary<string,double>>is just the type you want to deserialize to.{}in the first place? That is an empty object. And{}is not null hence your settings will not work. Also,Json.NETexpects a dictionary to be anobjectornull. Take a look at this question: stackoverflow.com/questions/45572652/…