Context
YAML 1.2.2 requires mapping keys to be unique in the representation graph. Equality is based on node kind, effective tag, and canonical content, not source spelling or the eventual PowerShell projection target.
Official YAML 1.2.2 references:
Current State
The module already rejects duplicate representation keys in many paths, and the conformance corpus documents known duplicate-key policy differences. This behavior should be captured as a deliberate public contract across all stream surfaces.
Objective
Make representation-key uniqueness a fully verified and documented behavior across conversion, import, validation, formatting, and merging.
PowerShell Design Considerations
- Duplicate-key failures should happen before projection into PowerShell objects, ordered dictionaries, hashtables, or typed objects.
- Rich object projection should never hide invalid YAML by letting a later property or dictionary value overwrite an earlier one.
- Complex keys should remain supported for
-AsHashtable and representation-preserving commands without weakening uniqueness checks. - Parameter sets should steer users toward lossless projections when complex keys are expected.
Tasks
Benefits
- Avoids silent data loss from overwritten mapping entries.
- Keeps rich PowerShell projections honest about YAML representation validity.
- Gives users predictable behavior for complex-key documents.
Acceptance Criteria
Related
- Spec folder:
spec/Representation-Key-Uniqueness.md
Context
YAML 1.2.2 requires mapping keys to be unique in the representation graph. Equality is based on node kind, effective tag, and canonical content, not source spelling or the eventual PowerShell projection target.
Official YAML 1.2.2 references:
spec/Representation-Key-Uniqueness.mdCurrent State
The module already rejects duplicate representation keys in many paths, and the conformance corpus documents known duplicate-key policy differences. This behavior should be captured as a deliberate public contract across all stream surfaces.
Objective
Make representation-key uniqueness a fully verified and documented behavior across conversion, import, validation, formatting, and merging.
PowerShell Design Considerations
-AsHashtableand representation-preserving commands without weakening uniqueness checks.Tasks
Benefits
Acceptance Criteria
YamlDuplicateKey.YamlDuplicateKey.Test-Yaml,Format-Yaml, andMerge-Yamlhandle duplicate keys consistently with conversion/import.Related
spec/Representation-Key-Uniqueness.md