You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
define 'mismatching' with an example ? In general, malformed json (or json not passing validation constraints) triggers exceptions for this library. You can trap those, but that's a questionable thing to do.
ConditionSettingsettingObj=new ConditionSetting();stringsettingJson= JsonConvert.SerializeObject(settingObj);// trying to parse a 'ObjectLayout' object from a 'ConditionSetting' json.// here i expect to got a null return value or an exception, // but infact i got a non-null 'ObjectLayout' objectObjectLayoutlayoutObj= JsonConvert.DeserializeObject<ObjectLayout>(settingJson);
print(layoutObj==null);// console print False
How to make JsonConvert.DeserializeObject() return null when json format mismatching?
The text was updated successfully, but these errors were encountered: