private static JsonPointer _BuildPointer(JsonValue?value) { var pointer = new JsonPointer(); if (value == null) { return(pointer); } switch (value.Type) { case JsonValueType.Object: if (!value.Object.Any()) { return(pointer); } var pair = value.Object.Last(); var key = pair.Key; pointer.Add(key); pointer.AddRange(_BuildPointer(pair.Value)); break; case JsonValueType.Array: if (!value.Array.Any()) { return(pointer); } var item = value.Array.Last(); var index = value.Array !.Count - 1; pointer.Add(index.ToString()); pointer.AddRange(_BuildPointer(item)); break; } return(pointer); }