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

Ensuring consistent indentation and preserving field order during YAML conversion. #675

Merged

Conversation

souvikinator
Copy link
Contributor

Description

This PR fixes #

Notes for Reviewers

Before:

  • ToYaml first unmarshalled to map[string]interface{} and since maps in Go are unordered, we are losing out on the arrangement of the fields.

After:

  • Changed the target type to yaml.Node to preserve field order.
  • Added a specific check for Node types since the JSON-first unmarshal was corrupting data without triggering an error.

next steps:

Signed commits

  • Yes, I signed my commits.

2. Added a specific check for Node types since the JSON-first unmarshal
  was corrupting data without triggering an error.

Signed-off-by: Souvik Kar Mahapatra <souvikat001@gmail.com>
Signed-off-by: Souvik Kar Mahapatra <souvikat001@gmail.com>
@leecalcote leecalcote merged commit c99eaae into meshery:master Feb 11, 2025
2 of 4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants