Json2CSharp / Json2CSharpCodeGenerator

Microsoft Reciprocal License
292 stars 81 forks source link

Array of Arrays Not Supported : Fail convert to c# .NET Core #89

Open ZzeLs opened 1 year ago

ZzeLs commented 1 year ago

I get a response string, then try to convert to C# classes and get json_original.txt

result convert

public class Root
{
    [JsonPropertyName("total_results")]
    public int TotalResults { get; set; }

    [JsonPropertyName("messages")]
    public List<List<>> Messages { get; set; }

    [JsonPropertyName("analytics_id")]
    public string AnalyticsId { get; set; }
}

What should the result be approximately

result.txt

What I tried to create magically to get the result above

json_change.txt

When I convert it into an object , I get all the data . When I transform it classes, I lose channel_id

Json2CSharp commented 1 year ago

yeah the tool doesn't support array of arrays yet so if you have an array inside an array it won't work

JasonPool commented 1 year ago

Do you have a plan for support it? I think this project is great and would like to use it in our project.

Json2CSharp commented 1 year ago

Yeah there are plans to support it but not in the near future though will need to fix other issues with more priority although any pull request or ideas to solve this are more than welcome