YamlDotNet icon indicating copy to clipboard operation
YamlDotNet copied to clipboard

Questions about multidimensional arrays

Open Fallen-G opened this issue 2 years ago • 3 comments
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:

image image

Fallen-G avatar Jan 16 '23 04:01 Fallen-G

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.

EdwardCooke avatar Feb 07 '23 00:02 EdwardCooke

I’ll work on this and try and squeeze it into the next release.

EdwardCooke avatar Jul 09 '24 07:07 EdwardCooke