Skip to content

🚀 [Feature]: Support complex mapping keys (? indicator) #25

@MariusStorhaug

Description

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:

  1. Reject with clear error — simplest; document that complex keys are not supported.
  2. Stringify the key — call .ToString() on the parsed key node and use that as the mapping key.
  3. 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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions