YamlDotNet
YamlDotNet copied to clipboard
Questions about multidimensional arrays
trafficstars
Hello, I want to generate a two-dimensional array, but the result is not quite what I expected.
This is my code:
using YamlDotNet.Serialization;
var serializer = new Serializer();
var array = new[,] { { 1, 1, 1 }, { 2, 2, 2 } };
serializer.Serialize(Console.Out, array);
And then, this is the output:
- 1
- 1
- 1
- 2
- 2
- 2
Expected output:
- - 1
- 1
- 1
- - 2
- 2
- 2
Maybe I need to change some configurations, but my English is not very good. I can't find any relevant examples. Can you give me some tips or help?
Environment:

That looks like a bug to me. When I get some time I can try and figure this out, however, we do accept pull requests, so if you want to give it a shot, go for it.
I’ll work on this and try and squeeze it into the next release.