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
Describe the bug
It looks like Tag Shorthands are not preserved when processing multiple documents when the subsequent documents do not have any directives. If I repeat the directives for subsequent documents (or expand Tag Shorthands into Verbatim Tags), then yq parses the stream correctly.
Version of yq: 4.16.2
Operating system: linux
Installed via: git clone & dpkg-buildpackage
%YAML 1.1
--- !<tag:example.com:1>Thing:
foo: 1
--- !<tag:example.com:2>Widget:
bar: 2
Command
The command you ran:
yq eval data1.yml
yq eval-all data1.yml
Actual behavior
eval:
%YAML 1.1!<tag:example.com:1>Thing:
foo: 1Error: bad file 'data1.yaml': yaml: line 4: found undefined tag handle
eval-all:
Error: bad file 'data1.yaml': yaml: line 4: found undefined tag handle
Expected behavior
%YAML 1.1!<tag:example.com:1>Thing:
foo: 1
---
!<tag:example.com:2>Widget:
bar: 2
Additional context
This seems to be a supported feature of YAML 1.1: "If the document specifies no directives, it is parsed using the same settings as the previous document.", but YAML 1.2 says: "Each document is completely independent from the rest.". It would be nice if the old 1.1 fallback was supported if possible.
The text was updated successfully, but these errors were encountered:
Describe the bug
It looks like Tag Shorthands are not preserved when processing multiple documents when the subsequent documents do not have any directives. If I repeat the directives for subsequent documents (or expand Tag Shorthands into Verbatim Tags), then
yq
parses the stream correctly.Version of yq: 4.16.2
Operating system: linux
Installed via: git clone & dpkg-buildpackage
Input Yaml
This doesn't work
data1.yml:
but this does:
data2.yml:
and so does this:
Command
The command you ran:
Actual behavior
eval:
eval-all:
Expected behavior
Additional context
This seems to be a supported feature of YAML 1.1: "If the document specifies no directives, it is parsed using the same settings as the previous document.", but YAML 1.2 says: "Each document is completely independent from the rest.". It would be nice if the old 1.1 fallback was supported if possible.
The text was updated successfully, but these errors were encountered: