Support quoting all strings in to yaml
#9536
Labels
enhancement
New feature or request
file-format
Parsing/Writing of file formats/protocols
needs-triage
An issue that hasn't had any proper look
Related problem
The
to yaml
command automatically unwraps scalar values. This causes an issue when working with CLI tools likekubeconform
anddatree
that still support older YAML standards like version 1.1. In version 1.1y
andn
were valid boolean values (https://yaml.org/type/bool.html). Nu's current behavior transforms strings like"n"
and"y"
inton
andy
that will triggers issues in 3rd party tools.Describe the solution you'd like
I'd like to have a feature flag like
-w
that causes all string values to be wrapped in quotes to avoid any interpretation of these values by other YAML parsers.Describe alternatives you've considered
As a more well-rounded solution, support for multiple YAML versions could be implemented for
from yaml
andto yaml
, e.g.from yaml -v 1.2 | to yaml -v 1.1
.Additional context and details
No response
The text was updated successfully, but these errors were encountered: