diff --git a/schemas/2023/08/bundled/config/document.json b/schemas/2023/08/bundled/config/document.json index e2ac11ee8..836ddc585 100644 --- a/schemas/2023/08/bundled/config/document.json +++ b/schemas/2023/08/bundled/config/document.json @@ -14,7 +14,7 @@ "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", @@ -290,12 +290,12 @@ }, "dependsOn": { "title": "Instance depends on", - "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the value of another DSC Resource instance's `name` property.", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", "type": "array", "items": { "type": "string", "uniqueItems": true, - "pattern": "^\\[\\w+(\\.\\w+){0,2}\\/\\w+\\].+$" + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$" } }, "properties": { @@ -345,8 +345,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/instanceName.json", "title": "Instance name", - "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document.", - "type": "string" + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 } } -} +} diff --git a/schemas/2023/08/bundled/config/document.vscode.json b/schemas/2023/08/bundled/config/document.vscode.json index ae7e5bf91..a0e57c7f7 100644 --- a/schemas/2023/08/bundled/config/document.vscode.json +++ b/schemas/2023/08/bundled/config/document.vscode.json @@ -432,15 +432,15 @@ }, "dependsOn": { "title": "Instance depends on", - "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the value of another DSC Resource instance's `name` property.", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", "type": "array", "items": { "type": "string", "uniqueItems": true, - "pattern": "^\\[\\w+(\\.\\w+){0,2}\\/\\w+\\].+$", - "patternErrorMessage": "Invalid value, must be a value like `[]`, such as `[Microsoft/OSInfo]Foo`.\n\nThe `` and `` should be the fully qualified type of the resource and its\nfriendly name in the configuration.\n" + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$", + "patternErrorMessage": "Invalid value, must be a value like `[resourceId('', '`)], such as\n`[resourceId('Microsoft/OSInfo', 'Foo')]`.\n\nThe `` and `` should be the fully qualified type of the resource and its\nfriendly name in the configuration.\n" }, - "markdownDescription": "> [Online Documentation][01]\n\nDefines a list of DSC Resource instances that DSC must successfully process before processing\nthis instance. Each value for this property must be the value of another DSC Resource\ninstance's `name` property.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserveView=true#properties-1\n" + "markdownDescription": "> [Online Documentation][01]\n\nDefines a list of DSC Resource instances that DSC must successfully process before processing\nthis instance. Each value for this property must be the `resourceID()` lookup for another\ninstance in the configuration. Multiple instances can depend on the same instance, but every\ndependency for an instance must be unique in that instance's `dependsOn` property.\n\nThe `resourceID()` function uses this syntax:\n\n```yaml\n\"[resourceId('', '']\"\n```\n\nThe `` value is the `type` property of the dependent resource and\n`` is the dependency's `name` property. When adding a dependency in a\nYAML-format configuration document, always wrap the `resourceID()` lookup in double quotes\n(`\"`).\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserveView=true#properties-1\n" }, "properties": { "title": "Managed instance properties", @@ -532,9 +532,12 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/instanceName.json", "title": "Instance name", - "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document.", + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", "type": "string", - "markdownDescription": "> [Online Documentation][01]\n\nThe short, human-readable name for a DSC Resource instance. Must be unique within a DSC\nConfiguration document.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserveView=true#name\n" + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1, + "patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n", + "markdownDescription": "> [Online Documentation][01]\n\nDefines the short, human-readable name for a DSC Resource instance. This property must be unique\nwithin a DSC Configuration document. If any resource instances share the same name, DSC raises an\nerror.\n\nThe instance name must be a non-empty string containing only letters, numbers, and spaces.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/config/resource?view=dsc-3.0&preserveView=true#name\n" } } } diff --git a/schemas/2023/08/bundled/outputs/config/get.json b/schemas/2023/08/bundled/outputs/config/get.json index 01e7b1b2b..673aa7f08 100644 --- a/schemas/2023/08/bundled/outputs/config/get.json +++ b/schemas/2023/08/bundled/outputs/config/get.json @@ -47,8 +47,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/instanceName.json", "title": "Instance name", - "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document.", - "type": "string" + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/resourceType.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", diff --git a/schemas/2023/08/bundled/outputs/config/set.json b/schemas/2023/08/bundled/outputs/config/set.json index 4cda22cb0..2cf07b03f 100644 --- a/schemas/2023/08/bundled/outputs/config/set.json +++ b/schemas/2023/08/bundled/outputs/config/set.json @@ -47,8 +47,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/instanceName.json", "title": "Instance name", - "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document.", - "type": "string" + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/resourceType.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", diff --git a/schemas/2023/08/bundled/outputs/config/test.json b/schemas/2023/08/bundled/outputs/config/test.json index 6c74c6720..372c8bd9e 100644 --- a/schemas/2023/08/bundled/outputs/config/test.json +++ b/schemas/2023/08/bundled/outputs/config/test.json @@ -47,8 +47,10 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/instanceName.json", "title": "Instance name", - "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document.", - "type": "string" + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 }, "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/resourceType.json": { "$schema": "https://json-schema.org/draft/2020-12/schema", diff --git a/schemas/2023/08/config/document.resource.json b/schemas/2023/08/config/document.resource.json index f35fa817f..493b8c516 100644 --- a/schemas/2023/08/config/document.resource.json +++ b/schemas/2023/08/config/document.resource.json @@ -17,12 +17,12 @@ }, "dependsOn": { "title": "Instance depends on", - "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the value of another DSC Resource instance's `name` property.", + "description": "Defines a list of DSC Resource instances that DSC must successfully process before processing this instance. Each value for this property must be the `resourceID()` lookup for another instance in the configuration. Multiple instances can depend on the same instance, but every dependency for an instance must be unique in that instance's `dependsOn` property.", "type": "array", "items": { "type": "string", "uniqueItems": true, - "pattern": "^\\[\\w+(\\.\\w+){0,2}\\/\\w+\\].+$" + "pattern": "^\\[resourceId\\(\\s*'\\w+(\\.\\w+){0,2}\\/\\w+'\\s*,\\s*'[a-zA-Z0-9 ]+'\\s*\\)\\]$" } }, "properties": { diff --git a/schemas/2023/08/definitions/instanceName.json b/schemas/2023/08/definitions/instanceName.json index ba86a225a..f7a2452a8 100644 --- a/schemas/2023/08/definitions/instanceName.json +++ b/schemas/2023/08/definitions/instanceName.json @@ -2,6 +2,8 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/definitions/instanceName.json", "title": "Instance name", - "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document.", - "type": "string" + "description": "The short, human-readable name for a DSC Resource instance. Must be unique within a DSC Configuration document. Must be a non-empty string containing only letters, numbers, and spaces.", + "type": "string", + "pattern": "^[a-zA-Z0-9 ]+$", + "minLength": 1 }