diff --git a/schemas/2023/08/bundled/config/document.json b/schemas/2023/08/bundled/config/document.json index b03ace6ef..0a0b72c2f 100644 --- a/schemas/2023/08/bundled/config/document.json +++ b/schemas/2023/08/bundled/config/document.json @@ -14,7 +14,9 @@ "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", "type": "string", "format": "uri", - "enum": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json" + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json" + ] }, "parameters": { "title": "DSC Configuration document parameters", @@ -51,7 +53,9 @@ "title": "Parameter", "description": "Defines a runtime option for a DSC Configuration Document.", "type": "object", - "required": "type", + "required": [ + "type" + ], "properties": { "type": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/parameters/dataTypes.json" diff --git a/schemas/2023/08/bundled/outputs/resource/get.json b/schemas/2023/08/bundled/outputs/resource/get.json index f1b85eb67..8ed6684d9 100644 --- a/schemas/2023/08/bundled/outputs/resource/get.json +++ b/schemas/2023/08/bundled/outputs/resource/get.json @@ -4,7 +4,9 @@ "title": "dsc resource get result", "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command.", "type": "object", - "required": "actualState", + "required": [ + "actualState" + ], "properties": { "actualState": { "title": "Actual state", diff --git a/schemas/2023/08/bundled/outputs/resource/list.json b/schemas/2023/08/bundled/outputs/resource/list.json index 2e93fd775..ba3fc778a 100644 --- a/schemas/2023/08/bundled/outputs/resource/list.json +++ b/schemas/2023/08/bundled/outputs/resource/list.json @@ -34,13 +34,17 @@ "title": "Standard implementation", "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", "type": "string", - "enum": "Command" + "enum": [ + "Command" + ] }, { "title": "Custom implementation", "description": "Indicates that the DSC Resource uses a custom implementation.", "type": "object", - "required": "custom", + "required": [ + "custom" + ], "properties": { "custom": { "title": "Custom implementation name", @@ -119,7 +123,9 @@ "title": "Manifest Version", "description": "The semver of the DSC Resource manifest schema to validate this manifest with.", "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/semver.json", - "enum": "1.0" + "enum": [ + "1.0" + ] }, "type": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/resourceType.json" @@ -179,13 +185,15 @@ "0": "Success", "1": "Error" }, - "examples": { - "0": "Success", - "1": "Invalid parameter", - "2": "Invalid input", - "3": "Registry error", - "4": "JSON serialization failed" - } + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] }, "schema": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/resource/manifest.schema.json" @@ -198,7 +206,9 @@ "title": "Get Method", "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -230,7 +240,9 @@ "title": "Get Method", "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -271,16 +283,18 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/returnKind.json" } }, - "examples": { - "executable": "registry", - "args": [ - "config", - "set" - ], - "input": "stdin", - "implementsPretest": true, - "return": "state" - } + "examples": [ + { + "executable": "registry", + "args": [ + "config", + "set" + ], + "input": "stdin", + "implementsPretest": true, + "return": "state" + } + ] }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.test.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -308,15 +322,17 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/returnKind.json" } }, - "examples": { - "executable": "registry", - "args": [ - "config", - "test" - ], - "input": "stdin", - "return": "state" - } + "examples": [ + { + "executable": "registry", + "args": [ + "config", + "test" + ], + "input": "stdin", + "return": "state" + } + ] }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.validate.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -324,7 +340,9 @@ "title": "Validate Method", "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -333,13 +351,15 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandArgs.json" } }, - "examples": { - "executable": "dsc", - "args": [ - "config", - "validate" - ] - } + "examples": [ + { + "executable": "dsc", + "args": [ + "config", + "validate" + ] + } + ] }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.provider.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -356,7 +376,9 @@ "title": "List Command", "description": "Defines how DSC must call the DSC Resource Provider to list its supported DSC Resources.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -376,19 +398,21 @@ ] } }, - "examples": { - "config": "full", - "list": { - "executable": "pwsh", - "args": [ - "-NoLogo", - "-NonInteractive", - "-NoProfile", - "-Command", - "./powershellgroup.resource.ps1 List" - ] + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } } - } + ] }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -398,10 +422,14 @@ "type": "object", "oneOf": [ { - "required": "command" + "required": [ + "command" + ] }, { - "required": "embedded" + "required": [ + "embedded" + ] } ], "properties": { @@ -409,7 +437,9 @@ "title": "Instance Schema Command", "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -514,7 +544,9 @@ { "command": { "executable": "registry", - "args": "schema" + "args": [ + "schema" + ] } }, { diff --git a/schemas/2023/08/bundled/resource/manifest.json b/schemas/2023/08/bundled/resource/manifest.json index 9148f835c..122a263dc 100644 --- a/schemas/2023/08/bundled/resource/manifest.json +++ b/schemas/2023/08/bundled/resource/manifest.json @@ -15,7 +15,9 @@ "title": "Manifest Version", "description": "The semver of the DSC Resource manifest schema to validate this manifest with.", "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/semver.json", - "enum": "1.0" + "enum": [ + "1.0" + ] }, "type": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/resourceType.json" @@ -75,13 +77,15 @@ "0": "Success", "1": "Error" }, - "examples": { - "0": "Success", - "1": "Invalid parameter", - "2": "Invalid input", - "3": "Registry error", - "4": "JSON serialization failed" - } + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] }, "schema": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/resource/manifest.schema.json" @@ -111,7 +115,9 @@ "title": "Get Method", "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -143,7 +149,9 @@ "title": "Get Method", "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -184,16 +192,18 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/returnKind.json" } }, - "examples": { - "executable": "registry", - "args": [ - "config", - "set" - ], - "input": "stdin", - "implementsPretest": true, - "return": "state" - } + "examples": [ + { + "executable": "registry", + "args": [ + "config", + "set" + ], + "input": "stdin", + "implementsPretest": true, + "return": "state" + } + ] }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.test.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -221,15 +231,17 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/returnKind.json" } }, - "examples": { - "executable": "registry", - "args": [ - "config", - "test" - ], - "input": "stdin", - "return": "state" - } + "examples": [ + { + "executable": "registry", + "args": [ + "config", + "test" + ], + "input": "stdin", + "return": "state" + } + ] }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.validate.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -237,7 +249,9 @@ "title": "Validate Method", "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -246,13 +260,15 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandArgs.json" } }, - "examples": { - "executable": "dsc", - "args": [ - "config", - "validate" - ] - } + "examples": [ + { + "executable": "dsc", + "args": [ + "config", + "validate" + ] + } + ] }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.provider.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -269,7 +285,9 @@ "title": "List Command", "description": "Defines how DSC must call the DSC Resource Provider to list its supported DSC Resources.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -289,19 +307,21 @@ ] } }, - "examples": { - "config": "full", - "list": { - "executable": "pwsh", - "args": [ - "-NoLogo", - "-NonInteractive", - "-NoProfile", - "-Command", - "./powershellgroup.resource.ps1 List" - ] + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } } - } + ] }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.schema.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", @@ -311,10 +331,14 @@ "type": "object", "oneOf": [ { - "required": "command" + "required": [ + "command" + ] }, { - "required": "embedded" + "required": [ + "embedded" + ] } ], "properties": { @@ -322,7 +346,9 @@ "title": "Instance Schema Command", "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -427,7 +453,9 @@ { "command": { "executable": "registry", - "args": "schema" + "args": [ + "schema" + ] } }, { diff --git a/schemas/2023/08/config/document.json b/schemas/2023/08/config/document.json index 8078b2ba7..234c5761a 100644 --- a/schemas/2023/08/config/document.json +++ b/schemas/2023/08/config/document.json @@ -14,7 +14,9 @@ "description": "This property must be the canonical URL of the DSC Configuration Document schema that the document is implemented for.", "type": "string", "format": "uri", - "enum": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json" + "enum": [ + "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json" + ] }, "parameters": { "title": "DSC Configuration document parameters", diff --git a/schemas/2023/08/config/document.parameter.json b/schemas/2023/08/config/document.parameter.json index 86b217054..82966dc9b 100644 --- a/schemas/2023/08/config/document.parameter.json +++ b/schemas/2023/08/config/document.parameter.json @@ -4,7 +4,9 @@ "title": "Parameter", "description": "Defines a runtime option for a DSC Configuration Document.", "type": "object", - "required": "type", + "required": [ + "type" + ], "properties": { "type": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/parameters/dataTypes.json" diff --git a/schemas/2023/08/outputs/resource/get.json b/schemas/2023/08/outputs/resource/get.json index 9c191c86e..00a306026 100644 --- a/schemas/2023/08/outputs/resource/get.json +++ b/schemas/2023/08/outputs/resource/get.json @@ -4,7 +4,9 @@ "title": "dsc resource get result", "description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command.", "type": "object", - "required": "actualState", + "required": [ + "actualState" + ], "properties": { "actualState": { "title": "Actual state", diff --git a/schemas/2023/08/outputs/resource/list.json b/schemas/2023/08/outputs/resource/list.json index 88eada11c..13b4a5094 100644 --- a/schemas/2023/08/outputs/resource/list.json +++ b/schemas/2023/08/outputs/resource/list.json @@ -34,13 +34,17 @@ "title": "Standard implementation", "description": "Indicates that the DSC Resource is implemented as one of the standard implementations built into DSC.", "type": "string", - "enum": "Command" + "enum": [ + "Command" + ] }, { "title": "Custom implementation", "description": "Indicates that the DSC Resource uses a custom implementation.", "type": "object", - "required": "custom", + "required": [ + "custom" + ], "properties": { "custom": { "title": "Custom implementation name", diff --git a/schemas/2023/08/resource/manifest.export.json b/schemas/2023/08/resource/manifest.export.json index e1fc9ed75..5c918b524 100644 --- a/schemas/2023/08/resource/manifest.export.json +++ b/schemas/2023/08/resource/manifest.export.json @@ -4,7 +4,9 @@ "title": "Get Method", "description": "Defines how DSC must call the DSC Resource to get the current state of every instance.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" diff --git a/schemas/2023/08/resource/manifest.get.json b/schemas/2023/08/resource/manifest.get.json index 8ccfa99b9..351aa81dd 100644 --- a/schemas/2023/08/resource/manifest.get.json +++ b/schemas/2023/08/resource/manifest.get.json @@ -4,7 +4,9 @@ "title": "Get Method", "description": "Defines how DSC must call the DSC Resource to get the current state of an instance.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" diff --git a/schemas/2023/08/resource/manifest.json b/schemas/2023/08/resource/manifest.json index 5abfbd96e..40185d7c4 100644 --- a/schemas/2023/08/resource/manifest.json +++ b/schemas/2023/08/resource/manifest.json @@ -15,7 +15,9 @@ "title": "Manifest Version", "description": "The semver of the DSC Resource manifest schema to validate this manifest with.", "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/semver.json", - "enum": "1.0" + "enum": [ + "1.0" + ] }, "type": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/resourceType.json" @@ -75,13 +77,15 @@ "0": "Success", "1": "Error" }, - "examples": { - "0": "Success", - "1": "Invalid parameter", - "2": "Invalid input", - "3": "Registry error", - "4": "JSON serialization failed" - } + "examples": [ + { + "0": "Success", + "1": "Invalid parameter", + "2": "Invalid input", + "3": "Registry error", + "4": "JSON serialization failed" + } + ] }, "schema": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/resource/manifest.schema.json" diff --git a/schemas/2023/08/resource/manifest.provider.json b/schemas/2023/08/resource/manifest.provider.json index 86f51156f..efbcbcf3a 100644 --- a/schemas/2023/08/resource/manifest.provider.json +++ b/schemas/2023/08/resource/manifest.provider.json @@ -13,7 +13,9 @@ "title": "List Command", "description": "Defines how DSC must call the DSC Resource Provider to list its supported DSC Resources.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -33,17 +35,19 @@ ] } }, - "examples": { - "config": "full", - "list": { - "executable": "pwsh", - "args": [ - "-NoLogo", - "-NonInteractive", - "-NoProfile", - "-Command", - "./powershellgroup.resource.ps1 List" - ] + "examples": [ + { + "config": "full", + "list": { + "executable": "pwsh", + "args": [ + "-NoLogo", + "-NonInteractive", + "-NoProfile", + "-Command", + "./powershellgroup.resource.ps1 List" + ] + } } - } + ] } diff --git a/schemas/2023/08/resource/manifest.schema.json b/schemas/2023/08/resource/manifest.schema.json index 39f84bbc7..58ab86d56 100644 --- a/schemas/2023/08/resource/manifest.schema.json +++ b/schemas/2023/08/resource/manifest.schema.json @@ -6,10 +6,14 @@ "type": "object", "oneOf": [ { - "required": "command" + "required": [ + "command" + ] }, { - "required": "embedded" + "required": [ + "embedded" + ] } ], "properties": { @@ -17,7 +21,9 @@ "title": "Instance Schema Command", "description": "Defines how DSC must call the DSC Resource to get the JSON Schema for validating a JSON blob representing an instance of the DSC Resource.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -122,7 +128,9 @@ { "command": { "executable": "registry", - "args": "schema" + "args": [ + "schema" + ] } }, { diff --git a/schemas/2023/08/resource/manifest.set.json b/schemas/2023/08/resource/manifest.set.json index d065286ad..7484863eb 100644 --- a/schemas/2023/08/resource/manifest.set.json +++ b/schemas/2023/08/resource/manifest.set.json @@ -29,14 +29,16 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/returnKind.json" } }, - "examples": { - "executable": "registry", - "args": [ - "config", - "set" - ], - "input": "stdin", - "implementsPretest": true, - "return": "state" - } + "examples": [ + { + "executable": "registry", + "args": [ + "config", + "set" + ], + "input": "stdin", + "implementsPretest": true, + "return": "state" + } + ] } diff --git a/schemas/2023/08/resource/manifest.test.json b/schemas/2023/08/resource/manifest.test.json index 0cf89b007..c503d5704 100644 --- a/schemas/2023/08/resource/manifest.test.json +++ b/schemas/2023/08/resource/manifest.test.json @@ -24,13 +24,15 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/returnKind.json" } }, - "examples": { - "executable": "registry", - "args": [ - "config", - "test" - ], - "input": "stdin", - "return": "state" - } + "examples": [ + { + "executable": "registry", + "args": [ + "config", + "test" + ], + "input": "stdin", + "return": "state" + } + ] } diff --git a/schemas/2023/08/resource/manifest.validate.json b/schemas/2023/08/resource/manifest.validate.json index fbb7b5e53..b646ae487 100644 --- a/schemas/2023/08/resource/manifest.validate.json +++ b/schemas/2023/08/resource/manifest.validate.json @@ -4,7 +4,9 @@ "title": "Validate Method", "description": "Defines how DSC must call the DSC Resource to validate the state of an instance. This method is mandatory for DSC Group Resources. It's ignored for all other DSC Resources.", "type": "object", - "required": "executable", + "required": [ + "executable" + ], "properties": { "executable": { "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandExecutable.json" @@ -13,11 +15,13 @@ "$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/commandArgs.json" } }, - "examples": { - "executable": "dsc", - "args": [ - "config", - "validate" - ] - } + "examples": [ + { + "executable": "dsc", + "args": [ + "config", + "validate" + ] + } + ] } diff --git a/schemas/build.ps1 b/schemas/build.ps1 index 2f6044c2d..1b11a8701 100644 --- a/schemas/build.ps1 +++ b/schemas/build.ps1 @@ -90,7 +90,16 @@ begin { if ($_.Value -is [Object[]]) { if ($_.Value.Count -ge 1) { $MungedKeyValue = Remove-JsonSchemaKey -KeyName $KeyName -SchemaList $_.Value - $MungedSchema.Add($_.Key, $MungedKeyValue) + # Need to ensure single-item returns get correctly handled as arays, + # not munged into scalars. + if ( + ($MungedKeyValue.Count -eq 1) -or + ($MungedKeyValue -is [Specialized.OrderedDictionary]) + ) { + $MungedSchema.Add($_.Key, [object[]]$MungedKeyValue) + } else { + $MungedSchema.Add($_.Key, $MungedKeyValue) + } } else { $MungedSchema.Add($_.Key, $_.Value) }