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

Anchor dereferencing fails with yq 3.0.1 #340

Closed
jodh-intel opened this issue Feb 4, 2020 · 3 comments
Closed

Anchor dereferencing fails with yq 3.0.1 #340

jodh-intel opened this issue Feb 4, 2020 · 3 comments
Labels

Comments

@jodh-intel
Copy link

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.

@jodh-intel jodh-intel changed the title Anchor dereferencing fails yq 3.0.1 Anchor dereferencing fails with yq 3.0.1 Feb 5, 2020
@mikefarah mikefarah added the bug label Feb 6, 2020
@mikefarah
Copy link
Owner

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

@mikefarah
Copy link
Owner

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

@jodh-intel
Copy link
Author

Thanks @mikefarah ! 😄

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

2 participants