You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the latest version of yq appears to break being able to add new objects to an existing array object, this was working fine as of version 2.4.1.
With this file:
applications:
- name: appenv:
I cannot use write to add an additional field to the 'env' object. I would expect this yq w hello.yml "applications[0].env.hello" "world"
to output the following:
applications:
- name: appenv:
hello: world
However, I am just getting the follow output:
applications:
- name: appenv:
I'm not sure if this is a result of the breaking change regarding "reading paths that don't exist" with the new version or not.
Adding new nodes to the array seems to work fine: yq w -v hello.yml "applications[0].hello" "WORLD"
applications:
- name: appenv:
hello: WORLD
yq w -v hello.yml "applications[0].hello.foo" "WORLD"
applications:
- name: appenv:
hello:
foo: WORLD
But I need to be able to update an existing node in the array. This is probably related to #356.
The text was updated successfully, but these errors were encountered:
dben1713
changed the title
Add new field to array object is failing in 3.1.1
Add new object to existing array object is failing in 3.1.1
Feb 17, 2020
Using the latest version of yq appears to break being able to add new objects to an existing array object, this was working fine as of version 2.4.1.
With this file:
I cannot use write to add an additional field to the 'env' object. I would expect this
yq w hello.yml "applications[0].env.hello" "world"
to output the following:
However, I am just getting the follow output:
I'm not sure if this is a result of the breaking change regarding "reading paths that don't exist" with the new version or not.
Adding new nodes to the array seems to work fine:
yq w -v hello.yml "applications[0].hello" "WORLD"
yq w -v hello.yml "applications[0].hello.foo" "WORLD"
But I need to be able to update an existing node in the array. This is probably related to #356.
The text was updated successfully, but these errors were encountered: