Context and request
None of the three public commands declares [OutputType()], and none documents .INPUTS, .OUTPUTS, or .NOTES. The MSX PowerShell function standard treats [OutputType()] and its matching .OUTPUTS block as the contract between a function and its callers, and PlatyPS renders both into the generated reference pages published at psmodule.io/Json. Today those pages carry no output contract at all.
Each command already has .SYNOPSIS, .DESCRIPTION, at least one .EXAMPLE, and a correct .LINK, so this completes existing help rather than writing it from scratch.
Acceptance criteria.
Format-Json, Import-Json, and Export-Json each declare [OutputType()], scoped per parameter set where the sets return different types.
- Each documents
.INPUTS and .OUTPUTS, with a description for every entry and fully-qualified .NET type names.
.OUTPUTS matches [OutputType()] exactly.
- Where no parameter accepts pipeline input,
.INPUTS reads None with You can't pipe objects to <CommandName>. as its description.
Get-Help <Command> -Full shows inputs and outputs for all three commands.
- The generated reference pages render the type as a heading with the description as body text below it.
Technical decisions
.INPUTS and .OUTPUTS use the PlatyPS blank-line format — type name on the first line, blank line, then the description as a plain paragraph:
.OUTPUTS
System.String
The formatted JSON text.
The single-line System.String. Description. form shown in about_Comment_Based_Help is not used: it triggers MD026 and puts a full sentence inside a ### heading when PlatyPS v2 processes it.
Type names are fully qualified — System.String, System.Management.Automation.PSCustomObject, System.IO.FileInfo — not accelerators.
Export-Json needs care on [OutputType()]. It emits System.IO.FileInfo only when -PassThru is supplied and nothing otherwise. Since that is a switch rather than a parameter set, a single unscoped [OutputType([System.IO.FileInfo])] is correct, with .OUTPUTS stating that output is produced only with -PassThru.
Import-Json currently emits objects carrying an injected _SourceFile property. The .OUTPUTS description documents the corrected contract — the deserialized document — not the current polluted one, so this should land after or alongside that correction.
This is a documentation and attribute change with no runtime behaviour change, which is why it is separated from the structural work on the same functions. src/ matches ImportantFilePatterns, so it still triggers a full build and warrants a Patch label.
Implementation plan
Context and request
None of the three public commands declares
[OutputType()], and none documents.INPUTS,.OUTPUTS, or.NOTES. The MSX PowerShell function standard treats[OutputType()]and its matching.OUTPUTSblock as the contract between a function and its callers, and PlatyPS renders both into the generated reference pages published at psmodule.io/Json. Today those pages carry no output contract at all.Each command already has
.SYNOPSIS,.DESCRIPTION, at least one.EXAMPLE, and a correct.LINK, so this completes existing help rather than writing it from scratch.Acceptance criteria.
Format-Json,Import-Json, andExport-Jsoneach declare[OutputType()], scoped per parameter set where the sets return different types..INPUTSand.OUTPUTS, with a description for every entry and fully-qualified .NET type names..OUTPUTSmatches[OutputType()]exactly..INPUTSreadsNonewithYou can't pipe objects to <CommandName>.as its description.Get-Help <Command> -Fullshows inputs and outputs for all three commands.Technical decisions
.INPUTSand.OUTPUTSuse the PlatyPS blank-line format — type name on the first line, blank line, then the description as a plain paragraph:The single-line
System.String. Description.form shown inabout_Comment_Based_Helpis not used: it triggers MD026 and puts a full sentence inside a###heading when PlatyPS v2 processes it.Type names are fully qualified —
System.String,System.Management.Automation.PSCustomObject,System.IO.FileInfo— not accelerators.Export-Jsonneeds care on[OutputType()]. It emitsSystem.IO.FileInfoonly when-PassThruis supplied and nothing otherwise. Since that is a switch rather than a parameter set, a single unscoped[OutputType([System.IO.FileInfo])]is correct, with.OUTPUTSstating that output is produced only with-PassThru.Import-Jsoncurrently emits objects carrying an injected_SourceFileproperty. The.OUTPUTSdescription documents the corrected contract — the deserialized document — not the current polluted one, so this should land after or alongside that correction.This is a documentation and attribute change with no runtime behaviour change, which is why it is separated from the structural work on the same functions.
src/matchesImportantFilePatterns, so it still triggers a full build and warrants aPatchlabel.Implementation plan
[OutputType([System.String])]toFormat-Jsonwith.INPUTScovering both pipeline-bound parameter sets and.OUTPUTSdescribing the formatted JSON text[OutputType([System.Management.Automation.PSCustomObject])]toImport-Jsonwith.INPUTSfor the pipeline-boundPathand.OUTPUTSdescribing the deserialized document[OutputType([System.IO.FileInfo])]toExport-Jsonwith.INPUTScovering both pipeline-bound sets and.OUTPUTSnoting output only occurs with-PassThru.NOTESwhere there is genuinely something a caller needs to know, and omit it where there is notGet-Help <Command> -Fullrenders all sections correctly for each command.OUTPUTSand[OutputType()]agree for every command