Skip to content

Commit c3d2fb8

Browse files
(SCHEMA) Update schemas for the provider->adapter rename
This change updates the source schemas to account for renaming DSC Resource Providers to DSC Resource Adapters in PowerShell#334. This is a breaking schema change that requires a new canonical URI, so the change also adds new schema URIs to DSC to account for the changes. The regenerated schemas will be added in the next commit.
1 parent ef36815 commit c3d2fb8

File tree

7 files changed

+45
-27
lines changed

7 files changed

+45
-27
lines changed

dsc_lib/src/configure/config_doc.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ pub struct Resource {
108108
#[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq, Deserialize, Serialize, JsonSchema)]
109109
pub enum DocumentSchemaUri {
110110
#[default]
111+
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json")]
112+
Version2024_04,
113+
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.json")]
114+
Bundled2024_04,
115+
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json")]
116+
VSCode2024_04,
111117
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json")]
112118
Version2023_10,
113119
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json")]
@@ -125,7 +131,7 @@ pub enum DocumentSchemaUri {
125131
impl Default for Configuration {
126132
fn default() -> Self {
127133
Self {
128-
schema: DocumentSchemaUri::Version2023_08,
134+
schema: DocumentSchemaUri::Version2024_04,
129135
parameters: None,
130136
variables: None,
131137
resources: Vec::new(),
@@ -138,7 +144,7 @@ impl Configuration {
138144
#[must_use]
139145
pub fn new() -> Self {
140146
Self {
141-
schema: DocumentSchemaUri::Version2023_08,
147+
schema: DocumentSchemaUri::Version2024_04,
142148
parameters: None,
143149
variables: None,
144150
resources: Vec::new(),

dsc_lib/src/dscresources/resource_manifest.rs

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ pub struct ResourceManifest {
6666
#[derive(Debug, Default, Clone, Copy, Hash, Eq, PartialEq, Deserialize, Serialize, JsonSchema)]
6767
pub enum ManifestSchemaUri {
6868
#[default]
69+
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.json")]
70+
Version2024_04,
71+
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json")]
72+
Bundled2024_04,
73+
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.vscode.json")]
74+
VSCode2024_04,
6975
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json")]
7076
Version2023_10,
7177
#[serde(rename = "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json")]

schemas/build.ps1

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ using namespace System.Collections
33

44
<#
55
.SYNOPSIS
6+
Build the DSC schema files from the source YAML files.
7+
8+
.DESCRIPTION
9+
This build script composes the JSON Schema files from the source YAML files, creating new
10+
files in the specified output directory. It creates a schema registry to analyze the source
11+
schemas and resolve references for bundling.
612
#>
713

814
[cmdletbinding(DefaultParameterSetName='ByConfig')]

schemas/schemas.config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
host: https://raw.githubusercontent.com
22
prefix: PowerShell/DSC/main/schemas
3-
version: 2023/10
3+
version: 2024/04
44
docs_base_url: https://learn.microsoft.com/powershell/dsc
55
docs_version_pin: view=dsc-3.0&preserve-view=true
66
bundle_schemas:

schemas/src/outputs/resource/list.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ properties:
8282
type: string
8383
pattern: ^\w+$
8484
requires:
85-
title: Required DSC Resource Provider
85+
title: Required DSC Resource Adapter
8686
description: >-
87-
Defines the fully qualified type name of the DSC Resource Provider the
87+
Defines the fully qualified type name of the DSC Resource Adapter the
8888
DSC Resource depends on.
8989
oneOf:
9090
- $ref: /<PREFIX>/<VERSION>/definitions/resourceType.yaml

schemas/src/resource/manifest.provider.yaml schemas/src/resource/manifest.adapter.yaml

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema
22
$schema: https://json-schema.org/draft/2020-12/schema
3-
$id: <HOST>/<PREFIX>/<VERSION>/resource/manifest.provider.yaml
3+
$id: <HOST>/<PREFIX>/<VERSION>/resource/manifest.adapter.yaml
44

5-
title: Provider
5+
title: Adapter
66
description: >-
7-
Defines the DSC Resource as a DSC Resource Provider. A DSC Resource Provider enables users to
7+
Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to
88
manage resources that don't have their own manifests with DSC.
99
markdownDescription: | # VS Code only
1010
***
1111
[_Online Documentation_][01]
1212
***
1313
14-
Defines the DSC Resource as a DSC Resource Provider. A DSC Resource Provider enables users to
14+
Defines the DSC Resource as a DSC Resource Adapter. A DSC Resource Adapter enables users to
1515
manage resources that don't have their own manifests with DSC.
1616
17-
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/provider?<DOCS_VERSION_PIN>
17+
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/adapter?<DOCS_VERSION_PIN>
1818
1919
type: object
2020
required:
@@ -24,15 +24,15 @@ properties:
2424
list:
2525
title: List Command
2626
description: >-
27-
Defines how DSC must call the DSC Resource Provider to list its supported DSC Resources.
27+
Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.
2828
markdownDescription: | # VS Code only
2929
***
3030
[_Online Documentation_][01]
3131
***
3232
33-
Defines how DSC must call the DSC Resource Provider to list its supported DSC Resources.
33+
Defines how DSC must call the DSC Resource Adapter to list its supported DSC Resources.
3434
35-
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/provider?<DOCS_VERSION_PIN>#list
35+
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/adapter?<DOCS_VERSION_PIN>#list
3636
type: object
3737
required:
3838
- executable
@@ -49,7 +49,7 @@ properties:
4949
is only required when the command isn't recognizable by the operating system as an
5050
executable.
5151
52-
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/provider?<DOCS_VERSION_PIN>#executable
52+
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/adapter?<DOCS_VERSION_PIN>#executable
5353
args:
5454
$ref: /<PREFIX>/<VERSION>/definitions/commandArgs.yaml
5555
markdownDescription: |
@@ -75,11 +75,11 @@ properties:
7575
registry resources list
7676
```
7777
78-
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/provider?<DOCS_VERSION_PIN>#args
78+
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/adapter?<DOCS_VERSION_PIN>#args
7979
config:
8080
title: Expected Configuration
8181
description: >-
82-
Defines whether the provider expects to receive a full and unprocessed configuration as a
82+
Defines whether the adapter expects to receive a full and unprocessed configuration as a
8383
single JSON blob over stdin or a sequence of JSON Lines for each child resource's
8484
configurations.
8585
type: string
@@ -92,21 +92,21 @@ properties:
9292
[_Online Documentation_][01]
9393
***
9494
95-
Defines whether the provider expects to receive a full and unprocessed configuration as a
95+
Defines whether the adapter expects to receive a full and unprocessed configuration as a
9696
single JSON blob over stdin or a sequence of JSON Lines for each child resource's
9797
configurations.
9898
99-
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/provider?<DOCS_VERSION_PIN>#config
99+
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/adapter?<DOCS_VERSION_PIN>#config
100100
markdownEnumDescriptions:
101101
- | # full
102102
_Full and unprocessed config as a JSON blob_
103103
104-
> Indicates that the provider expects a JSON blob containing the full and unprocessed
104+
> Indicates that the adapter expects a JSON blob containing the full and unprocessed
105105
> configuration as a single JSON blob over `stdin`.
106106
- | # sequence
107107
_Resource instances as JSON Lines_
108108
109-
> Indicates that the provider expects each resource's configuration as a [JSON Line][01]
109+
> Indicates that the adapter expects each resource's configuration as a [JSON Line][01]
110110
> over `stdin`.
111111
112112
[01]: https://jsonlines.org/
@@ -125,7 +125,7 @@ examples:
125125
defaultSnippets: # VS Code only
126126
- label: ' Define without arguments'
127127
markdownDescription: |
128-
Define the provider config kind and `list` command for the resource when no arguments are
128+
Define the adapter config kind and `list` command for the resource when no arguments are
129129
required.
130130
body:
131131
config: $1
@@ -134,7 +134,7 @@ defaultSnippets: # VS Code only
134134

135135
- label: ' Define with arguments'
136136
markdownDescription: |
137-
Define the provider config kind and `list` command for the resource when at least one
137+
Define the adapter config kind and `list` command for the resource when at least one
138138
argument is required.
139139
body:
140140
config: $1

schemas/src/resource/manifest.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ defaultSnippets:
9393
description: ${23:explanation of property purpose and usage}
9494
type: ${24|string,integer,number,array,object,null|}
9595

96-
- label: ' Define a resource (provider)'
96+
- label: ' Define a resource (adapter)'
9797
markdownDescription: |-
98-
Defines a provider resource that enables users to define non-command-based DSC Resources in
98+
Defines an adapter resource that enables users to define non-command-based DSC Resources in
9999
the configuration.
100100
body:
101101
$schema: <HOST>/<PREFIX>/<VERSION>/bundled/resource/manifest.yaml
@@ -117,7 +117,7 @@ defaultSnippets:
117117
input: ${15:stdin}
118118
implementsPretest: ^${16:false}
119119
return: ${17:state}
120-
provider:
120+
adapter:
121121
config: ${18|full,sequence|}
122122
list:
123123
executable: ${19:executable name}
@@ -373,8 +373,8 @@ properties:
373373
$ref: /<PREFIX>/<VERSION>/resource/manifest.test.yaml
374374
validate:
375375
$ref: /<PREFIX>/<VERSION>/resource/manifest.validate.yaml
376-
provider:
377-
$ref: /<PREFIX>/<VERSION>/resource/manifest.provider.yaml
376+
adapter:
377+
$ref: /<PREFIX>/<VERSION>/resource/manifest.adapter.yaml
378378
exitCodes:
379379
# This setting in the root of the schema implies exit codes must have the
380380
# same meaning across all executions. What about implementations that

0 commit comments

Comments
 (0)