I have the following JSON and would like to deserialize it to the class structure below. I know I need to mess with the deserialization process but I don't find good examples for my use case. I also would like to use System.Text.Json.Serialization
instead on Newtonsoft.Json
.
{
"warnings": {
"123456789": [
{ .. },
{ .. }
],
"987654321": [
{ .. },
{ .. }
],
"893427443": [
{ .. },
{ .. }
],
...
}
}
public class Root {
public List<WarningArea> WarningAreas {get;set;}
}
public class WarningArea {
public int AreaId {get;set;}
public List<Warning> Warnings {get;set;}
}
public class Warning {
...
}