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

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -