yq
yq copied to clipboard
"YAML" directive 1.2 causes: Error: yaml: found incompatible YAML document
Describe the bug A "YAML" directive causes the following:
Error: yaml: found incompatible YAML document
Version of yq: 4.12.2 Operating system: mac Installed via: homebrew
Input Yaml data1.yml:
%YAML 1.2
---
foo
Command The command you ran:
yq eval '' data1.yml
Actual behavior
Error: yaml: found incompatible YAML document
Expected behavior
foo
Additional context The YAML specification says:
A version 1.2 YAML processor must accept documents with an explicit “%YAML 1.2” directive
The following causes this issue: https://github.com/go-yaml/yaml/issues/298
The go-yaml repo has been pretty quite lately :(
I realize that there's not much that can be done about this. Feel free to close this issue.
Fixed in v4.30 (basically I preprocess files so go-yaml never sees it)