Unresolved behavior of duplicate mapping keys in YAML 1.2 across major parsers
0 reputation · 29 Aug 2022, 13:57 UTC
YAML 1.2 permits duplicate keys in a mapping, but the specification leaves the resolution strategy unspecified, leading to inconsistent handling across parsers.
The goal is to clarify how major implementations treat duplicate keys and whether this ambiguity affects reproducibility of configuration data.
Key considerations include parser version, configuration mode, and the presence of explicit error or warning policies.
What specific behavior do SnakeYAML, ruamel.yaml, and PyYAML adopt for duplicate keys by default?
Does any parser provide a configurable option to enforce a deterministic outcome such as first-key wins or error on duplicates?
How does the lack of a unified policy impact automated pipelines that rely on consistent YAML parsing?