I am trying to find a path of a JSON value. Consider the following JSON:
{ \"car\": { \"type\": [{ \"sedan\": { \"mak
There is also a way to retrieve the path just by the value, using linq. You will need Json.NET for this.
JObject jo = JObject.Parse(json); var token = jo.Descendants() .OfType() .Where(p => p.Value.ToString() == "honda") .First(); Console.WriteLine(token.Path);
See: https://dotnetfiddle.net/vZ1zLg