I've got the string value :
var jsonStringValue= "[{\"id\": \"001\",\"schoolName\": \"Johnson Primary School\",\"rules\": \"[{\\\"key\\\":\\\"bc92f\\\",\\\"student\\\":\\\"peter\\\",\\\"class\\\":\\\"6A\\\"},{\\\"key\\\":\\\"c929\\\",\\\"student\\\":null,\\\"class\\\":null}]\"}]"
and I want to expect to produce the JsonObject or dynamic object as below
[
{
"id": "001",
"schoolName": "Johnson Primary School",
"rules": [
{
"key": "bc92f",
"student": "peter",
"class": "6A"
},
{
"key": "c929",
"student": null,
"class": null
}
]
}
]
But I cannot do it in this code :
var jsonObject = System.Text.Json.JsonSerializer.Deserialize<JsonObject>(jsonStringValue);
because the rules inside contain slash or sometime it have \r\n can I know how to convert it by using System.Text.Json.JsonSerializer in dotnet 6?
Thank you