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

YamlDotNet does not write accurately equal to yaml being loaded #426

Closed
kokizzu opened this issue Aug 13, 2019 · 4 comments
Closed

YamlDotNet does not write accurately equal to yaml being loaded #426

kokizzu opened this issue Aug 13, 2019 · 4 comments

Comments

@kokizzu
Copy link

kokizzu commented Aug 13, 2019

Example input file any scene from Unity3D. Example code:

var input = new StringReader(File.ReadAllText("Scene1.unity"));
var yaml = new YamlStream();
yaml.Load(input);
var tw = File.CreateText(sc.path + ".yaml");
yaml.Save(tw);

Verification shell command:
diff Scene1.unity Scene1.unity.yaml
^ got totally different result

image

@aaubry
Copy link
Owner

aaubry commented Aug 14, 2019

Please try using the Save() overload that takes a boolean:

var input = new StringReader(File.ReadAllText("Scene1.unity"));
var yaml = new YamlStream();
yaml.Load(input);
var tw = File.CreateText(sc.path + ".yaml");
yaml.Save(tw, false);

The default behaviour is to assign anchors to nodes, but that feature has some issues.

@aaubry
Copy link
Owner

aaubry commented Sep 25, 2019

I will close this issue as there has been no feedback. Feel free to reopen it if necessary.

@aaubry aaubry closed this as completed Sep 25, 2019
@lx1988
Copy link

lx1988 commented Jan 17, 2024

This problem still exists,
I already use yaml.Save(tw, false);
but The format is still wrong

@EdwardCooke
Copy link
Collaborator

Can you paste raw yaml and a small reproduction of code for the problem? That’ll help immensely. But the difference looks like anchors.

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

No branches or pull requests

4 participants