Skip to content

Add unordered hashtable projection mode #67

Description

Context

PowerShell users often want YAML mappings as unordered Hashtable values rather than ordered dictionaries or objects. This is a projection capability, not a YAML conformance requirement, but it affects how rich objects flow through the pipeline.

Official YAML 1.2.2 reference:

Current State

The module can project mappings as objects or insertion-ordered dictionaries. There is no dedicated unordered hashtable projection mode.

Objective

Add an idiomatic PowerShell projection option for unordered hashtables while preserving existing object and ordered-dictionary behavior.

PowerShell Design Considerations

  • Parameter sets should make object, ordered dictionary, unordered hashtable, and future typed projection choices mutually clear.
  • Hashtable projection should be useful in normal pipeline workflows and splatting scenarios.
  • Complex or non-string YAML keys need explicit behavior because ordinary PowerShell hashtables can technically hold object keys but may surprise users.
  • Do not use hashtable projection to bypass duplicate representation-key validation.

Tasks

  • Add an explicit hashtable projection option.
  • Define how nested mappings project under that option.
  • Preserve existing default object projection and ordered dictionary projection.
  • Define behavior for complex, null, empty, and case-colliding keys.
  • Document pipeline and splatting examples.

Benefits

  • Better matches common PowerShell authoring patterns.
  • Makes projection choice explicit and discoverable.
  • Avoids forcing users to convert ordered dictionaries manually.

Acceptance Criteria

  • A mapping can be returned as a Hashtable when the caller requests it.
  • Nested mappings follow the requested projection policy.
  • Duplicate YAML representation keys still fail before hashtable projection.
  • Existing default and ordered projection behavior remain unchanged.
  • Parameter-set help makes projection modes clear.

Related

  • Spec folder: spec/Hashtable-Projection.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions