Anchors and aliases let a YAML document reference the same node multiple times.
Request
ConvertFrom-Yaml should resolve aliases to the anchored node:
defaults: &defaults
timeout: 30
retries: 3
production:
<<: *defaults
host: prod.example.com
Note: the << merge key is a separate (legacy YAML 1.1) feature and is not part of YAML 1.2.2 core. Decide whether to support it as an opt-in extension.
ConvertTo-Yaml does not need to emit anchors automatically (the spec allows but does not require it). Round-tripping anchors is out of scope for v1.
Spec examples covered
- Example 2.10 — Node "Sammy Sosa" appears twice
- Parts of Example 2.27 (Invoice)
Implementation notes
- Anchor scope is per-document. Multi-document support (separate issue) is a prerequisite for full correctness.
- Cyclic references should be detected and rejected (or surfaced as an error) since PowerShell objects do not naturally represent graphs.
Anchors and aliases let a YAML document reference the same node multiple times.
Request
ConvertFrom-Yamlshould resolve aliases to the anchored node:Note: the
<<merge key is a separate (legacy YAML 1.1) feature and is not part of YAML 1.2.2 core. Decide whether to support it as an opt-in extension.ConvertTo-Yamldoes not need to emit anchors automatically (the spec allows but does not require it). Round-tripping anchors is out of scope for v1.Spec examples covered
Implementation notes