Here is my JSON. It is valid according to https://jsonlint.com/
[{"page":1,"pages":1,"per_page":"50","total":1},[{"id":"GBR"}]]
So this looks very simple. It's based on data from the WorldBank, but I have simplified it. Here are my POCO objects:
public class Rootobject
{
public PagesObject Pages { get; set; }
public List<WorldBankCountryContainer> NestedListContainer {get; set;}
}
public class WorldBankCountryContainer
{
[JsonProperty("id")]
public string id { get; set; }
}
public class PagesObject
{
[JsonProperty("page")]
public int Page { get; set; }
[JsonProperty("pages")]
public int Pages { get; set; }
[JsonProperty("per_page")]
public string PerPage { get; set; }
[JsonProperty("total")]
public long Total { get; set; }
}
And I cannot deserialize it like this :
var countryData = JsonSerializer.Deserialize<List<Rootobject>[]>(json);
(The above will work without the 'pages' anonynmous object in the JSON.)