Hi there! I am dealing with a non standard json string, here:
string a = "[[\"test, test\",\"{\\\"prop1\\\":1,\\\"prop2\\\":\\\"test\\\",\\\"prop3\\\":\\\"test\\\"}\"],[\"test2, test2\",\"{\\\"prop1\\\":2,\\\"prop2\\\":\\\"test2\\\",\\\"prop3\\\":\\\"test2\\\"}\"]]";
And trying to parse this string to an object. Tried, like, everything :( Nothing works. I am not really sure, if I understand this json structure correctly. I would really appreciate, if someone could help me with this. Here is formatted JSON:
[
[
"test",
{
"prop1": 1,
"prop2": "test",
"prop3": "test"
}
],
[
"test2",
{
"prop1": 2,
"prop2": "test2",
"prop3": "test2"
}
]
]
But I still do not understand its structure.
What I have tried:
I have created some objects for this json, as far as I can understand its structure. Here they are:
class Details
{
public int prop1 { get; set; }
public string prop2 { get; set; }
public string prop3 { get; set; }
}
class Name
{
public string FullName { get; set; }
}
class Class
{
public Name FullName { get; set; }
public Details Details { get; set; }
}
And trying to deserialize this way:
string a = "[[\"test, test\",\"{\\\"prop1\\\":1,\\\"prop2\\\":\\\"test\\\",\\\"prop3\\\":\\\"test\\\"}\"],[\"test2, test2\",\"{\\\"prop1\\\":2,\\\"prop2\\\":\\\"test2\\\",\\\"prop3\\\":\\\"test2\\\"}\"]]";
List< Class > obj = JsonConvert.DeserializeObject<List<Class>>(a);