YAML allows arbitrary nodes (sequences, mappings) as mapping keys via the ? indicator. PowerShell hashtables and [PSCustomObject] only accept scalar keys, so this maps awkwardly.
Request
Parse ? complex keys without erroring. Output strategy options:
- Reject with clear error — simplest; document that complex keys are not supported.
- Stringify the key — call
.ToString() on the parsed key node and use that as the mapping key.
- Use
[ordered] hashtable with object keys — works in PowerShell but doesn't survive -AsHashtable → JSON round-trip.
Recommend option 1 for v1 with a meaningful error message, then revisit if anyone asks for it.
Spec examples covered
- Example 2.11 — Mapping between Sequences
Notes
This is the lowest-priority spec gap — complex keys are rare in real-world YAML.
YAML allows arbitrary nodes (sequences, mappings) as mapping keys via the
?indicator. PowerShell hashtables and[PSCustomObject]only accept scalar keys, so this maps awkwardly.Request
Parse
?complex keys without erroring. Output strategy options:.ToString()on the parsed key node and use that as the mapping key.[ordered]hashtable with object keys — works in PowerShell but doesn't survive-AsHashtable→ JSON round-trip.Recommend option 1 for v1 with a meaningful error message, then revisit if anyone asks for it.
Spec examples covered
Notes
This is the lowest-priority spec gap — complex keys are rare in real-world YAML.