Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about multidimensional arrays #770

Open
Fallen-G opened this issue Jan 16, 2023 · 3 comments
Open

Questions about multidimensional arrays #770

Fallen-G opened this issue Jan 16, 2023 · 3 comments
Labels

Comments

@Fallen-G
Copy link

Fallen-G commented Jan 16, 2023

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

@EdwardCooke
Copy link
Collaborator

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 EdwardCooke added the bug label Feb 7, 2023
@EdwardCooke
Copy link
Collaborator

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

@BRIZEIUM
Copy link

BRIZEIUM commented Dec 24, 2024

I encountered the same issue and hope multidimensional arrays can be supported. Thank you. @EdwardCooke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants