-
Notifications
You must be signed in to change notification settings - Fork 38
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
Ensure that YAML marshalling maintains field ordering #235
Comments
And is the order even stable ? I think it might not be. If we can find a non-intrusive way of getting a desired ordering, then it is worth a shot, but I agree that this is not too high on the list of priority-ordered TODO list. |
I was under the impression that for json files the ordering of the fields is stable and defined by the order in which they are defined in a struct. If one uses the standard go YAML library, then this is also the case, but it requires that one add explict YAML tags to the structs definitions. |
I have created #236 as an example of the required changes. |
I think it's quite important for people who prefer to use yaml. Preserving an order is much more readable. |
When outputing the following spec as YAML:
We get the following output:
Which does not maintain ordering of the fields as defines in the spec.
The JSON output is as follows:
The text was updated successfully, but these errors were encountered: