Open Sc7-git opened 11 months ago
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis See info in area-owners.md if you want to be subscribed.
Author: | Sc7-git |
---|---|
Assignees: | - |
Labels: | `area-System.Text.Json` |
Milestone: | - |
Duplicate of #44347. Currently there's no support for MD array.
Three years later, and STJ is significantly more mature. Can we use this issue to have another look at implementing it?
Not sure what a JSON representation of a MD array would look like, though. I wonder if there are any precedents.
Not sure what a JSON representation of a MD array would look like, though.
There doesn't appear to be a standard representation being used anywhere, although using jagged arrays is probably the safest (although likely not the most efficient) representation. I found this article discussing various approaches.
There doesn't appear to be a standard representation being used anywhere, although using jagged arrays is probably the safest (although likely not the most efficient) representation.
Newtonsoft.Json does this too:
int[,] matrix = new int[2, 3]
{
{ 1, 2, 3 },
{ 4, 5, 6 }
};
System.Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(matrix));
[[1,2,3],[4,5,6]]
Description
Reproduction Steps
Expected behavior
Return serialization result
Actual behavior
The type 'System.Int32[,]' is not supported.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response