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
String values that are treated as implicitly boolean by some processors are treated as strings by yq, and pretty-printing therefore removes the quotes, causing the tag to implicitly change.
This is surprising, because it looks to me as though the underlying go-yaml library has the existing support for this.
Version of yq: 4.11.2
Operating system: Linux
Installed via: go get github.com/mikefarah/yq/v4
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
input.yml:
a_string_value: "yes"
Command
The command you ran:
yq -Pe e '.' input.yml
Actual behavior
a_string_value: yes
Expected behavior
a_string_value: "yes"
Additional context
Similarly, b: yes run through yq -Pe e 'b | tag' results in !!str, whereas it should arguably be !!bool - this matters rather less than the output above.
It looks like this relates to YAML 1.1, rather than YAML 1.2, so this probably isn't a "bug" in the "you did something wrong" sense, but it's problematic because existing processors (including parts of Docker) appear to treat an unquoted "yes" as implicitly a !!bool.
The text was updated successfully, but these errors were encountered:
Describe the bug
See: http://yaml.org/type/bool.html
String values that are treated as implicitly boolean by some processors are treated as strings by yq, and pretty-printing therefore removes the quotes, causing the tag to implicitly change.
This is surprising, because it looks to me as though the underlying go-yaml library has the existing support for this.
Version of yq: 4.11.2
Operating system: Linux
Installed via:
go get github.com/mikefarah/yq/v4
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
input.yml:
Command
The command you ran:
Actual behavior
Expected behavior
Additional context
Similarly,
b: yes
run throughyq -Pe e 'b | tag'
results in!!str
, whereas it should arguably be!!bool
- this matters rather less than the output above.It looks like this relates to YAML 1.1, rather than YAML 1.2, so this probably isn't a "bug" in the "you did something wrong" sense, but it's problematic because existing processors (including parts of Docker) appear to treat an unquoted "yes" as implicitly a
!!bool
.The text was updated successfully, but these errors were encountered: