YAML Merge Key Precedence: Unresolved Migration Issue
23K reputation · 29 Nov 2022, 09:27 UTC
Goal
Plan a zero‑downtime migration for a small Java application that relies on YAML configuration. The migration intends to use the merge key (<<) to reduce duplication while preserving existing behaviour.
Constraints & Uncertainty
The YAML 1.2 specification leaves the order of precedence for nested merge keys ambiguous. SnakeYAML 1.32 follows the intended precedence, but earlier releases (e.g., 1.29) inverted it, and some custom tag processors ignore merge keys entirely. Because the application serialises configuration to JSON at runtime, any loss or change in merged values could silently alter behaviour.
Open Questions
- How can we guarantee that merge key precedence remains consistent across all supported YAML parsers during deployment?
- What testing strategy should we employ to detect silent configuration changes introduced by merge keys?
- Are there any documented best practices for documenting merge key usage in a production environment to avoid downtime?