Skip to content

Support anchors and aliases #22

Description

Why

Anchors and aliases let a YAML document reference the same node multiple times without duplicating it. Without support, documents that rely on this — common in shared configuration templates — cannot be parsed correctly.

What

ConvertFrom-Yaml should resolve aliases to their anchored node, for example:

defaults: &defaults
  timeout: 30
  retries: 3

production:
  <<: *defaults
  host: prod.example.com

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)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions