Yq: Anchor dereferencing fails with yq 3.0.1

Created on 4 Feb 2020  路  3Comments  路  Source: mikefarah/yq

Assuming the following test file:

$ cat >foo.yaml<<EOT
value: &value-pointer the value
pointer: *value-pointer
EOT

With previous versions of yq, we'd see the expected behaviour:

$ yq r foo.yaml value
the value
$ yq r foo.yaml pointer
the value

However, with yq version 3.0.1:

$ yq r foo.yaml value
the value
$ yq r foo.yaml pointer
*value-pointer

Oddly, this works in JSON mode:

$ yq -j r foo.yaml pointer
"the value"

Sounds like this is related to #339.

bug

All 3 comments

Nice pick up - will have a fix in the next release

Fixed in https://github.com/mikefarah/yq/releases/tag/3.1.0 see https://mikefarah.gitbook.io/yq/commands/read#exploding-anchors :)

Thanks @mikefarah ! :smile:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmreicha picture jmreicha  路  9Comments

il1yaz picture il1yaz  路  3Comments

IdanAdar picture IdanAdar  路  9Comments

infa-ddeore picture infa-ddeore  路  5Comments

tamalsaha picture tamalsaha  路  5Comments