diff --git a/dsc_lib/src/configure/config_doc.rs b/dsc_lib/src/configure/config_doc.rs index a3d96f2e..9781a8f0 100644 --- a/dsc_lib/src/configure/config_doc.rs +++ b/dsc_lib/src/configure/config_doc.rs @@ -108,6 +108,12 @@ pub struct Resource { #[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq, Deserialize, Serialize, JsonSchema)] pub enum DocumentSchemaUri { #[default] + #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json")] + Version2024_04, + #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.json")] + Bundled2024_04, + #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json")] + VSCode2024_04, #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json")] Version2023_10, #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json")] @@ -125,7 +131,7 @@ pub enum DocumentSchemaUri { impl Default for Configuration { fn default() -> Self { Self { - schema: DocumentSchemaUri::Version2023_08, + schema: DocumentSchemaUri::Version2024_04, parameters: None, variables: None, resources: Vec::new(), @@ -138,7 +144,7 @@ impl Configuration { #[must_use] pub fn new() -> Self { Self { - schema: DocumentSchemaUri::Version2023_08, + schema: DocumentSchemaUri::Version2024_04, parameters: None, variables: None, resources: Vec::new(), diff --git a/dsc_lib/src/dscresources/resource_manifest.rs b/dsc_lib/src/dscresources/resource_manifest.rs index 99d4ce93..40cbaa38 100644 --- a/dsc_lib/src/dscresources/resource_manifest.rs +++ b/dsc_lib/src/dscresources/resource_manifest.rs @@ -66,6 +66,12 @@ pub struct ResourceManifest { #[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq, Deserialize, Serialize, JsonSchema)] pub enum ManifestSchemaUri { #[default] + #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.json")] + Version2024_04, + #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json")] + Bundled2024_04, + #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.vscode.json")] + VSCode2024_04, #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json")] Version2023_10, #[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json")] diff --git a/schemas/build.ps1 b/schemas/build.ps1 index 75e3d06a..fd996ef6 100644 --- a/schemas/build.ps1 +++ b/schemas/build.ps1 @@ -3,6 +3,12 @@ using namespace System.Collections <# .SYNOPSIS + Build the DSC schema files from the source YAML files. + + .DESCRIPTION + This build script composes the JSON Schema files from the source YAML files, creating new + files in the specified output directory. It creates a schema registry to analyze the source + schemas and resolve references for bundling. #> [cmdletbinding(DefaultParameterSetName='ByConfig')] diff --git a/schemas/schemas.config.yaml b/schemas/schemas.config.yaml index 7715bf0e..3f4ced14 100644 --- a/schemas/schemas.config.yaml +++ b/schemas/schemas.config.yaml @@ -1,6 +1,6 @@ host: https://raw.githubusercontent.com prefix: PowerShell/DSC/main/schemas -version: 2023/10 +version: 2024/04 docs_base_url: https://learn.microsoft.com/powershell/dsc docs_version_pin: view=dsc-3.0&preserve-view=true bundle_schemas: diff --git a/schemas/src/outputs/resource/list.yaml b/schemas/src/outputs/resource/list.yaml index f6a09bc9..79ad6c07 100644 --- a/schemas/src/outputs/resource/list.yaml +++ b/schemas/src/outputs/resource/list.yaml @@ -82,9 +82,9 @@ properties: type: string pattern: ^\w+$ requires: - title: Required DSC Resource Provider + title: Required DSC Resource Adapter description: >- - Defines the fully qualified type name of the DSC Resource Provider the + Defines the fully qualified type name of the DSC Resource Adapter the DSC Resource depends on. oneOf: - $ref: ///definitions/resourceType.yaml diff --git a/schemas/src/resource/manifest.provider.yaml b/schemas/src/resource/manifest.adapter.yaml similarity index 72% rename from schemas/src/resource/manifest.provider.yaml rename to schemas/src/resource/manifest.adapter.yaml index f1c704f0..39cf0f93 100644 --- a/schemas/src/resource/manifest.provider.yaml +++ b/schemas/src/resource/manifest.adapter.yaml @@ -1,20 +1,20 @@ # yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema $schema: https://json-schema.org/draft/2020-12/schema -$id: ///resource/manifest.provider.yaml +$id: ///resource/manifest.adapter.yaml -title: Provider +title: Adapter description: >- - Defines the DSC Resource as a DSC Resource Provider. A DSC Resource Provider enables users to + Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC. markdownDescription: | # VS Code only *** [_Online Documentation_][01] *** - Defines the DSC Resource as a DSC Resource Provider. A DSC Resource Provider enables users to + Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to manage resources that don't have their own manifests with DSC. - [01]: /reference/schemas/resource/manifest/provider? + [01]: /reference/schemas/resource/manifest/adapter? type: object required: @@ -24,15 +24,15 @@ properties: list: title: List Command description: >- - Defines how DSC must call the DSC Resource Provider to list its supported DSC Resources. + Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources. markdownDescription: | # VS Code only *** [_Online Documentation_][01] *** - Defines how DSC must call the DSC Resource Provider to list its supported DSC Resources. + Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources. - [01]: /reference/schemas/resource/manifest/provider?#list + [01]: /reference/schemas/resource/manifest/adapter?#list type: object required: - executable @@ -49,7 +49,7 @@ properties: is only required when the command isn't recognizable by the operating system as an executable. - [01]: /reference/schemas/resource/manifest/provider?#executable + [01]: /reference/schemas/resource/manifest/adapter?#executable args: $ref: ///definitions/commandArgs.yaml markdownDescription: | @@ -75,11 +75,11 @@ properties: registry resources list ``` - [01]: /reference/schemas/resource/manifest/provider?#args + [01]: /reference/schemas/resource/manifest/adapter?#args config: title: Expected Configuration description: >- - Defines whether the provider expects to receive a full and unprocessed configuration as a + Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations. type: string @@ -92,21 +92,21 @@ properties: [_Online Documentation_][01] *** - Defines whether the provider expects to receive a full and unprocessed configuration as a + Defines whether the adapter expects to receive a full and unprocessed configuration as a single JSON blob over stdin or a sequence of JSON Lines for each child resource's configurations. - [01]: /reference/schemas/resource/manifest/provider?#config + [01]: /reference/schemas/resource/manifest/adapter?#config markdownEnumDescriptions: - | # full _Full and unprocessed config as a JSON blob_ - > Indicates that the provider expects a JSON blob containing the full and unprocessed + > Indicates that the adapter expects a JSON blob containing the full and unprocessed > configuration as a single JSON blob over `stdin`. - | # sequence _Resource instances as JSON Lines_ - > Indicates that the provider expects each resource's configuration as a [JSON Line][01] + > Indicates that the adapter expects each resource's configuration as a [JSON Line][01] > over `stdin`. [01]: https://jsonlines.org/ @@ -125,7 +125,7 @@ examples: defaultSnippets: # VS Code only - label: ' Define without arguments' markdownDescription: | - Define the provider config kind and `list` command for the resource when no arguments are + Define the adapter config kind and `list` command for the resource when no arguments are required. body: config: $1 @@ -134,7 +134,7 @@ defaultSnippets: # VS Code only - label: ' Define with arguments' markdownDescription: | - Define the provider config kind and `list` command for the resource when at least one + Define the adapter config kind and `list` command for the resource when at least one argument is required. body: config: $1 diff --git a/schemas/src/resource/manifest.yaml b/schemas/src/resource/manifest.yaml index 5aaedf32..8827815c 100644 --- a/schemas/src/resource/manifest.yaml +++ b/schemas/src/resource/manifest.yaml @@ -93,9 +93,9 @@ defaultSnippets: description: ${23:explanation of property purpose and usage} type: ${24|string,integer,number,array,object,null|} - - label: ' Define a resource (provider)' + - label: ' Define a resource (adapter)' markdownDescription: |- - Defines a provider resource that enables users to define non-command-based DSC Resources in + Defines an adapter resource that enables users to define non-command-based DSC Resources in the configuration. body: $schema: ///bundled/resource/manifest.yaml @@ -117,7 +117,7 @@ defaultSnippets: input: ${15:stdin} implementsPretest: ^${16:false} return: ${17:state} - provider: + adapter: config: ${18|full,sequence|} list: executable: ${19:executable name} @@ -373,8 +373,8 @@ properties: $ref: ///resource/manifest.test.yaml validate: $ref: ///resource/manifest.validate.yaml - provider: - $ref: ///resource/manifest.provider.yaml + adapter: + $ref: ///resource/manifest.adapter.yaml exitCodes: # This setting in the root of the schema implies exit codes must have the # same meaning across all executions. What about implementations that