My previously working code (dotnet 6.0) that was serialising a complex object, stopped producing Json output at the API controller. The object(s) are defined as:
public class ReportResultsDTO
{
public string ReportTitle { get; set; }
public List<ReportResultDTO> Results { get; set; } = [];
}
public class ReportResultDTO
{
public string Title { get; set; }
public List<Dictionary<string, object>> Data;
}
Turns out that because System.Net.Text is now used by default (rather than Newtonsoft.Json) it doesn’t handle converting List<Dictionary<string, objectto Json. I tried converting it to a Json string first and outputting that, but the returned string was full of \” characters to escape the string(s).…