Open lousyd opened 5 years ago
yq depends on PyYAML for YAML deserialization. This bug is therefore blocked by https://github.com/yaml/pyyaml/issues/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. [...]