Mapping key presentation style does not round-trip on the Tagged path #13
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status (2026-07-12)
Open. Disclosed as a known limit while closing #9: per-node presentation
styles now survive parse and dump for every VALUE node (
Tagged.Scalar,Tagged.Sequence,Tagged.Mappingall carrystyle), but a mapping KEY'sscalar style is not carried anywhere.
Tagged.Pairholds the key as a bareStringpluskeyTag; the key's source style (quoted vs plain) is readduring composition and discarded.
Impact
A document whose keys are deliberately quoted (
"on": trueto defeat theYAML 1.1 boolean resolution of
on, or keys with spaces) re-emits throughTagged.Dumperwith the emitter's ownescapeKeypolicy instead of thesource's quoting choice. The VALUE is never wrong (escapeKey quotes whatever
needs quoting), so this is a fidelity gap, not a correctness bug: byte-level
key presentation does not round-trip.
Work
Tagged.Paircarries a key noderather than a
String, the style field arrives for free with it, and thedumper's pair rendering can honor it the same way
renderScalarValuealready honors value styles.
carried, so quoted-key fixtures gate the behavior.
Part of #8. Blocked by #12.