Skip to content

Complete Json's data-module command surface #33

Open
0 of 4 issues completed
Open

Description

Context and request

Module types defines the verb vocabulary every data module is expected to cover and names Json as one of the modules following that pattern. Hashtable is cited as the module that demonstrates the full set. Json currently exposes Format-Json, Import-Json, and Export-Json — three of the eight verbs — so a user who can merge, diff, or prune a hashtable has no equivalent for JSON and has to drop back to raw object manipulation.

Verb pattern Status in Json
ConvertFrom-<Format> Collides with the built-in ConvertFrom-Json
ConvertTo-<Format> Collides with the built-in ConvertTo-Json
Import-<Noun> Present
Export-<Noun> Present
Format-<Noun> Present
Merge-<Noun> Missing
Compare-<Noun> Missing
Test-<Noun> Collides with the built-in Test-Json
Remove-<Noun>Entry Missing

Scope

In scope: the three genuinely missing commands, and a recorded decision on the three that collide with PowerShell built-ins.

Out of scope: shadowing or replacing any built-in cmdlet, and any command not in the data-module vocabulary.

Aggregate acceptance criteria

  • Get-Command -Module Json returns the agreed command set.
  • Every new command follows the patterns established by the function-standard work: [OutputType()], complete comment-based help, pipeline support where meaningful, and prose parameter set names.
  • Behaviour is consistent with the Hashtable equivalents where the operation is analogous, so users moving between the modules are not surprised.
  • The position on the built-in overlap is documented where a user will find it, not only in this issue.
  • Every new command is covered by tests and the suite still meets the 95% coverage target.

Technical decisions

Each new command is an independent deliverable with its own tests and reference page, so each gets its own Task rather than being bundled.

The built-in collision is resolved by decision, not by implementation. ConvertFrom-Json, ConvertTo-Json, and Test-Json all ship in PowerShell 7 and are well understood; redefining them in a module that users import for convenience would be actively hostile. The likely outcome is to document that the module defers to the built-ins for those three verbs, but that needs to be stated rather than assumed, because the archetype page currently reads as though every module covers the full vocabulary.

This PBI depends on the function-standard and correctness work landing first. New commands should be written against the corrected patterns, and Merge-Json and Compare-Json both traverse nested structures, where the depth handling that is currently wrong in Export-Json would otherwise be copied forward.

Implementation plan

Delivery is tracked through the native sub-issues on this PBI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions