Open
Description
Describe the bug
=
assignment is broken for nested keys following referenced one-level up property related to them.
Version of yq: 4.34.2
Operating system: Linux 22.04 Ubuntu
Installed via: sudo apt install yq
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml:
{
"first": {
"type": "string"
},
"second": {
"type": "string"
},
"referenced": {
"type": "string"
},
"third": {
"type": "string"
},
"fourth": {
"type": "string"
}
}
Command
The command you ran:
yq -P -o json '.[].type = .referenced'
Actual behavior
{
"first": {
"type": {
"type": "string"
}
},
"second": {
"type": {
"type": "string"
}
},
"referenced": {
"type": {
"type": "string"
}
},
"third": {
"type": {
"type": {
"type": "string"
}
}
},
"fourth": {
"type": {
"type": {
"type": "string"
}
}
}
}
Expected behavior
{
"first": {
"type": {
"type": "string"
}
},
"second": {
"type": {
"type": "string"
}
},
"referenced": {
"type": {
"type": "string"
}
},
"third": {
"type": {
"type": "string"
}
},
"fourth": {
"type": {
"type": "string"
}
}
}
type
keys after referenced
key are assigned incorrectly. I've compared output with jq
and it works as expected.