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

Unexpected order when adding multiple elements to array #2143

Open
ryenus opened this issue Sep 6, 2024 · 0 comments
Open

Unexpected order when adding multiple elements to array #2143

ryenus opened this issue Sep 6, 2024 · 0 comments
Labels

Comments

@ryenus
Copy link
Contributor

ryenus commented Sep 6, 2024

Describe the bug

When trying to sequentially append two objects to an array, say array + o1 + o2, instead of appending o1 then appending o2, yq combined the objects o1 and o2, then appended the new object to the array.

Version of yq: 4.44.3
Operating system: mac
Installed via: homebrew

Input Yaml
N/A

Command

The command you ran:

yq -n '[] + {"a":1} + {"b":2}'

Actual behavior

- a: 1
  b: 2

Expected behavior

- a: 1
- b: 2

Additional context
Add any other context about the problem here.

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

No branches or pull requests

1 participant