-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
unmarshal with comments provide wrong structure #459
Comments
Per note in the other issue, that yaml seems valid. Which parser is failing to handle it? |
@niemeyer no parser, just when you look on it seems to be wrong , it should be the same as before the unmarseling process, what do you think ? |
The description above states it's invalid yaml. That looks and parses as valid yaml representing the same data that was unmarshalled. We also currently do not attempt to preserve 100% of the formatting of the yaml parsed. The intent is to produce a format that most people would find pleasant by default. For example, in your input the comment is indented at a different column than the content it's documenting. At least to my taste that feels awkward. |
I had same issue. Read from file then Unmarshal it and the structure changed. It seems that the pkg sort it when Unmarshal. yaml file:
after Unmarshal:
|
One of my users has reported that this is breaking his cassandra's docker entry point |
Sorry, I still don't understand what the issue is here. The two maps reported above are exactly the same yaml. That's also completely unrelated to comments since neither of them have any comments whatsoever. If someone wants to report an issue, please do so in a slightly more readable form. |
This is the version
and run the following code which includes valid yaml
The output is
please see that the comment is starting the array and not the
name
property which should start the array .expected yaml
if I remove the comment (first app) it looks ok, but with the comment change the yaml to invalid yaml, I think the comment and the state of the yaml is one of the killer feature in V3
The text was updated successfully, but these errors were encountered: