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

Generate YAML documents that are structurally and field-order consistent with JSON. #1701

Closed

Conversation

liut
Copy link

@liut liut commented Nov 8, 2023

Generate YAML documents that are structurally and field-order consistent with JSON.

Describe the PR
When generating a document in JSON format, it preserves the field order defined by the x-order tag; however, when generating a document in YAML format, since it is converted from JSON internally, it first converts to any (i.e., an empty interface{} which is actually a map[string]any structure), see JSONToYAML, causing the field order to be disrupted. The yq library can be used to directly maintain the original defined order.

Relation issue
e.g. not found

Additional context
not now

@liut liut closed this Nov 29, 2023
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.

1 participant