YAML to JSON Block Scalar Trailing Newline: Why \n Appears
A YAML literal block written with a bare pipe keeps its final line break, and JSON can only show that character as an escape. Compare |, |- and |+ and check the decoded value.
A YAML literal block written with a bare pipe keeps its final line break, and JSON can only show that character as an escape. Compare |, |- and |+ and check the decoded value.
YAML anchors and merge keys are a writing shortcut, not a JSON feature. See a side-by-side example of how a YAML to JSON converter expands aliases and merges into repeated values, why that can make JSON output larger, and why converting back cannot restore the original anchors.
If you have ever spent hours tracking down a mysterious deployment failure only to discover a single misplaced space in your YAML configuration file, you already understand why a reliable YAML formatter…