Skip to content

Commit 448b89b

Browse files
michaeltlombardiSteveL-MSFT
authored andcommitted
(PowerShellGH-642) Document schema URI publishing and update manifest/config ref
This change drafts a new reference document that explains how the DSC schemas are published, the URIs DSC recognizes for those schemas, and updates the documentation for the resource manifest and configuration document schemas with the updated context. A future change will address updating the rest of the reference documentation.
1 parent 7665f85 commit 448b89b

File tree

3 files changed

+724
-48
lines changed

3 files changed

+724
-48
lines changed

docs/reference/schemas/config/document.md

+44-34
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: JSON schema reference for a Desired State Configuration document.
3-
ms.date: 01/17/2024
3+
ms.date: 02/28/2025
44
ms.topic: reference
55
title: DSC Configuration document schema reference
66
---
@@ -15,7 +15,7 @@ The YAML or JSON file that defines a DSC Configuration.
1515

1616
```yaml
1717
SchemaDialect: https://json-schema.org/draft/2020-12/schema
18-
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
18+
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json
1919
Type: object
2020
```
2121
@@ -29,7 +29,14 @@ A configuration document can be defined as either YAML or JSON. For ease of auth
2929
recommends drafting configuration documents in YAML.
3030
3131
For DSC's authoring tools to recognize a file as a DSC Configuration document, the filename must
32-
end with `.dsc.config.json`, `.dsc.config.yml`, or `.dsc.config.yaml`.
32+
end with one of the following:
33+
34+
- `.dsc.config.json`
35+
- `.dsc.config.yml`
36+
- `.dsc.config.yaml`.
37+
- `.dsc.json`
38+
- `.dsc.yml`
39+
- `.dsc.yaml`
3340

3441
You can use configuration document functions to dynamically determine values in the document at
3542
runtime. For more information, see [DSC Configuration document functions reference][01]
@@ -46,29 +53,23 @@ The rest of this document describes the schema DSC uses to validation configurat
4653

4754
Every configuration document must include these properties:
4855

49-
- [$schema]
50-
- [resources]
56+
- [$schema](#schema)
57+
- [resources](#resources)
5158

5259
## Properties
5360

5461
### $schema
5562

56-
The `$schema` property indicates the canonical URL for the version of this schema that the document
57-
adheres to. DSC uses this property when validating the configuration document before any
58-
configuration operations.
59-
60-
There are currently 3 published versions of the schema, compatible with different versions of DSC:
61-
62-
- `2024/04` is the latest version of the schema, compatible with DSC version 3.0.0-preview.7 and
63-
later.
64-
- `2023/10` is the previous version of the schema, compatible with DSC versions `3.0.0-alpha.4` and
65-
`3.0.0-alpha.5`.
66-
- `2023/08` is the first version of the schema, compatible with DSC versions `3.0.0-alpha.1` through
67-
`3.0.0-alpha.3`.
63+
The `$schema` property indicates the URI that resolves to the version of this schema that the
64+
document adheres to. DSC uses this property when validating and processing the configuration
65+
document.
6866

69-
This documentation is for the latest version of the schema. You should update your configuration
70-
documents and resource manifests to the latest version of the schema. Prior versions don't work
71-
with new releases of DSC. The schemas remain published, but won't get any updates.
67+
The JSON schemas for DSC are published in multiple versions and forms. This documentation is for
68+
the latest version of the schema. As a convenience, you can specify either the full URI for the
69+
schema hosted in GitHub or use the shorter `aka.ms` URI. You can specify the schema for a specific
70+
semantic version, the latest schema for a minor version, or the latest schema for a major version
71+
of DSC. For more information about schema URIs and versioning, see
72+
[DSC JSON Schema URIs](../schema-uris.md).
7273

7374
For every version of the schema, there are three valid urls:
7475

@@ -79,12 +80,12 @@ For every version of the schema, there are three valid urls:
7980

8081
- `.../bundled/config/document.json`
8182

82-
The URL to the bundled schema. When it's used for validation, the validating client only needs to
83-
retrieve this schema.
83+
The URL to the canonically bundled schema. When it's used for validation, the validating client
84+
only needs to retrieve this schema.
8485

8586
This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can still
8687
validate the document when it uses this schema, other tools may error or behave in unexpected
87-
ways.
88+
ways if they don't fully support the 2020-12 specification.
8889

8990
- `.../bundled/config/document.vscode.json`
9091

@@ -100,15 +101,24 @@ Type: string
100101
Required: true
101102
Format: URI
102103
ValidValues: [
103-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
104-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.json
105-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json
106-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
107-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json
108-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json
109-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
110-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.json
111-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/config/document.vscode.json
104+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json
105+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json
106+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json
107+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json
108+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json
109+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json
110+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json
111+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json
112+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json
113+
https://aka.ms/dsc/schemas/v3/config/document.json
114+
https://aka.ms/dsc/schemas/v3/bundled/config/document.json
115+
https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json
116+
https://aka.ms/dsc/schemas/v3.0/config/document.json
117+
https://aka.ms/dsc/schemas/v3.0/bundled/config/document.json
118+
https://aka.ms/dsc/schemas/v3.0/bundled/config/document.vscode.json
119+
https://aka.ms/dsc/schemas/v3.0.0/config/document.json
120+
https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.json
121+
https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.vscode.json
112122
]
113123
```
114124

@@ -142,7 +152,7 @@ For more information about defining parameters in a configuration, see
142152
```yaml
143153
Type: object
144154
Required: false
145-
ValidPropertySchema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.parameter.json
155+
ValidPropertySchema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.parameter.json
146156
```
147157

148158
### variables
@@ -178,7 +188,7 @@ For more information about defining a valid resource instance in a configuration
178188
Type: array
179189
Required: true
180190
MinimumItemCount: 1
181-
ValidItemSchema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.resource.json
191+
ValidItemSchema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.resource.json
182192
```
183193

184194
<!-- Link reference definitions -->

docs/reference/schemas/resource/manifest/root.md

+30-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: JSON schema reference for a DSC Resource manifest
3-
ms.date: 06/24/2024
3+
ms.date: 02/28/2025
44
ms.topic: reference
55
title: Command-based DSC Resource manifest schema reference
66
---
@@ -15,7 +15,7 @@ The data file that defines a command-based DSC Resource.
1515

1616
```yaml
1717
SchemaDialect: https://json-schema.org/draft/2020-12/schema
18-
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.json
18+
SchemaID: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json
1919
Type: object
2020
```
2121
@@ -48,6 +48,13 @@ The `$schema` property indicates the canonical URI of this schema that the manif
4848
against. This property is mandatory. DSC uses this value to validate the manifest against the
4949
correct JSON schema.
5050

51+
The JSON schemas for DSC are published in multiple versions and forms. This documentation is for
52+
the latest version of the schema. As a convenience, you can specify either the full URI for the
53+
schema hosted in GitHub or use the shorter `aka.ms` URI. You can specify the schema for a specific
54+
semantic version, the latest schema for a minor version, or the latest schema for a major version
55+
of DSC. For more information about schema URIs and versioning, see
56+
[DSC JSON Schema URIs](../schema-uris.md).
57+
5158
For every version of the schema, there are three valid urls:
5259

5360
- `.../resource/manifest.json`
@@ -57,12 +64,12 @@ For every version of the schema, there are three valid urls:
5764

5865
- `.../bundled/resource/manifest.json`
5966

60-
The URL to the bundled schema. When it's used for validation, the validating client only needs to
61-
retrieve this schema.
67+
The URL to the canonically bundled schema. When it's used for validation, the validating client
68+
only needs to retrieve this schema.
6269

6370
This schema uses the bundling model introduced for JSON Schema 2020-12. While DSC can still
6471
validate the document when it uses this schema, other tools may error or behave in unexpected
65-
ways.
72+
ways if they don't fully support the 2020-12 specification.
6673

6774
- `.../bundled/resource/manifest.vscode.json`
6875

@@ -78,15 +85,24 @@ Type: string
7885
Required: true
7986
Format: URI
8087
ValidValues: [
81-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/resource/manifest.json
82-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.json
83-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/resource/manifest.vscode.json
84-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json
85-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json
86-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json
87-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/resource/manifest.json
88-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json
89-
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.vscode.json
88+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json
89+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json
90+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json
91+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json
92+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json
93+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json
94+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json
95+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json
96+
https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json
97+
https://aka.ms/dsc/schemas/v3/resource/manifest.json
98+
https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json
99+
https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json
100+
https://aka.ms/dsc/schemas/v3.0/resource/manifest.json
101+
https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.json
102+
https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.vscode.json
103+
https://aka.ms/dsc/schemas/v3.0.0/resource/manifest.json
104+
https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.json
105+
https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.vscode.json
90106
]
91107
```
92108

0 commit comments

Comments
 (0)