c# - Reading Json without a property name -
we have following invalid json being returned customer of ours, there way can convert valid json object using newtonsoft library ?
tried load invalid json using jtoken in jsonconverter throwing exception
invalid character after parsing property name. expected ':' got: }. path 'description[0]'
//invalid json { "description": [{"apple"}]} //valid json { "description": [{"type": "apple"}]}
thanks in advance -nen
as said before, it's better fix source of invalid json response patch code, here's suggestion:
string invalidresponse = @"{ ""description"": [{""apple""}]}"; string validrespone = invalidresponse.replace(@"""description"": [{", @"""description"": [{""type"":");
Comments
Post a Comment