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
$ yq '.' test.yml
yq: Error running jq: ComposerError: found duplicate anchor 'because'; first occurrence
in"test.yml", line 2, column 10
second occurrence
in"test.yml", line 5, column 9.
According to the YAML specs, duplicate anchors are valid:
3.2.2.2. Anchors and Aliases
[...] When composing a representation graph from serialized events, an alias node refers to the most recent node in the serialization having the specified anchor. Therefore, anchors need not be unique within a serialization. [...]
7.1. Alias Nodes
[...] The alias refers to the most recent preceding node having the same anchor. [...]
The text was updated successfully, but these errors were encountered:
yq depends on PyYAML for YAML deserialization. This bug is therefore blocked by yaml/pyyaml#100 in PyYAML. Please file a comment or new issue in that reposotory.
Is there a specific use case that you have in mind?
Thank you for the reference. I don't have a representative use case, I don't think. I just came across the problem while trying to process gitlab ci yaml files. Some of the files have duplicate anchors. I modified a local copy of those files in order to workaround the problem for the time being.
I have a file like this:
...and get this error when processing it with yq:
According to the YAML specs, duplicate anchors are valid:
3.2.2.2. Anchors and Aliases
[...] When composing a representation graph from serialized events, an alias node refers to the most recent node in the serialization having the specified anchor. Therefore, anchors need not be unique within a serialization. [...]
7.1. Alias Nodes
[...] The alias refers to the most recent preceding node having the same anchor. [...]
The text was updated successfully, but these errors were encountered: