Skip to content

Commit 2b99caa

Browse files
authored
Merge pull request #648 from michaeltlombardi/gh-642/main/schema-casing-canonicalization
(GH-642) Ensure camelCase for items in `dsc_lib`
2 parents 41bd1c8 + ffb0424 commit 2b99caa

File tree

398 files changed

+40161
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

398 files changed

+40161
-549
lines changed

.github/ISSUE_TEMPLATE/Bug_Report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ body:
3535
3636
```yaml
3737
# repro.dsc.config.yaml
38-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
38+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
3939
resources:
4040
- name: repro
4141
type: Test/Echo

.vscode/docs.code-snippets

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"",
4343
"```yaml",
4444
"# ${1:name}.example.1.dsc.config.yaml",
45-
"\\$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json",
45+
"\\$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json",
4646
"resources:",
4747
"- name: ${7:descriptive resource name}",
4848
" type: Test/Echo",
@@ -101,7 +101,7 @@
101101
"",
102102
"```yaml",
103103
"# $TM_FILENAME_BASE.example.$1.dsc.config.yaml",
104-
"\\$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json",
104+
"\\$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json",
105105
"resources:",
106106
"- name: ${4:descriptive resource name}",
107107
" type: Test/Echo",

archive/registry/registry.dsc.resource.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/bundled/resource/manifest.json",
2+
"$schema": "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json",
33
"type": "Microsoft.Windows/Registry",
44
"description": "Manage Windows Registry keys and values",
55
"tags": [

configurations/windows/windows_baseline.dsc.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# This configuration validates a Windows system against a security baseline configuration
2-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
2+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
33
metadata:
44
Microsoft.DSC:
5-
securityContext: Elevated
5+
securityContext: elevated
66
resources:
77
- name: Validate the OS is Windows
88
type: Microsoft.DSC/Assertion
99
properties:
10-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
10+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
1111
resources:
1212
- name: os
1313
type: Microsoft/OSInfo
@@ -18,7 +18,7 @@ resources:
1818
dependsOn:
1919
- "[resourceId('Microsoft.DSC/Assertion','Validate the OS is Windows')]"
2020
properties:
21-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
21+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
2222
resources:
2323
- name: Default RDP port
2424
type: Microsoft.Windows/Registry

configurations/windows/windows_inventory.dsc.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
1+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
22
resources:
33
- name: Validate the OS is Windows
44
type: Microsoft.DSC/Assertion
55
properties:
6-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
6+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
77
resources:
88
- name: os
99
type: Microsoft/OSInfo

docs/reference/cli/config/get.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Command line reference for the 'dsc config get' command
3-
ms.date: 06/24/2024
3+
ms.date: 02/28/2025
44
ms.topic: reference
55
title: dsc config get
66
---
@@ -49,12 +49,12 @@ document saved as `example.dsc.config.yaml`.
4949

5050
```yaml
5151
# example.dsc.config.yaml
52-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
52+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
5353
resources:
5454
- name: Windows only
5555
type: Microsoft.DSC/Assertion
5656
properties:
57-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
57+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
5858
resources:
5959
- name: os
6060
type: Microsoft/OSInfo

docs/reference/cli/config/set.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Command line reference for the 'dsc config set' command
3-
ms.date: 06/24/2024
3+
ms.date: 02/28/2025
44
ms.topic: reference
55
title: dsc config set
66
---
@@ -50,12 +50,12 @@ The command inspects the resource instances defined in the configuration documen
5050

5151
```yaml
5252
# example.dsc.config.yaml
53-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
53+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
5454
resources:
5555
- name: Windows only
5656
type: Microsoft.DSC/Assertion
5757
properties:
58-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
58+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
5959
resources:
6060
- name: os
6161
type: Microsoft/OSInfo

docs/reference/cli/config/test.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Command line reference for the 'dsc config test' command
3-
ms.date: 06/24/2024
3+
ms.date: 02/28/2025
44
ms.topic: reference
55
title: dsc config test
66
---
@@ -49,12 +49,12 @@ resource instances defined in the configuration document saved as `example.dsc.c
4949

5050
```yaml
5151
# example.dsc.config.yaml
52-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
52+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
5353
resources:
5454
- name: Windows only
5555
type: Microsoft.DSC/Assertion
5656
properties:
57-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
57+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
5858
resources:
5959
- name: os
6060
type: Microsoft/OSInfo

docs/reference/cli/resource/list.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Command line reference for the 'dsc resource list' command
3-
ms.date: 06/24/2024
3+
ms.date: 02/28/2025
44
ms.topic: reference
55
title: dsc resource list
66
---
@@ -309,24 +309,24 @@ a summary table for the returned resources. The summary table includes the follo
309309
displayed in the listed order:
310310

311311
- **Type** - The fully qualified type name of the resource.
312-
- **Kind** - Whether the resource is an `Adapter`, `Group`, or typical `Resource`. For more
313-
information, see [DSC Resource kind schema reference][03].
312+
- **Kind** - Whether the resource is an `adapter`, `group`, `importer`, or typical `Resource`. For
313+
more information, see [DSC Resource kind schema reference][03].
314314
- **Version** - The semantic version of the resource.
315315
- **Caps** - A display of the resource's [capabilities][04] as flags. The capabilities are
316316
displayed in the following order, using a `-` instead of the appropriate letter if the resource
317317
doesn't have a specific capability:
318318

319-
- `g` indicates that the resource has the [Get capability][05].
320-
- `s` indicates that the resource has the [Set capability][06]
321-
- `x` indicates that the resource has the [SetHandlesExist capability][07]
322-
- `w` indicates that the resource has the [WhatIf capability][08]
323-
- `t` indicates that the resource has the [Test capability][09]
324-
- `d` indicates that the resource has the [Delete capability][10]
325-
- `e` indicates that the resource has the [Export capability][11]
326-
- `r` indicates that the resource has the [Resolve capability][12]
319+
- `g` indicates that the resource has the [get capability][05].
320+
- `s` indicates that the resource has the [set capability][06]
321+
- `x` indicates that the resource has the [setHandlesExist capability][07]
322+
- `w` indicates that the resource has the [whatIf capability][08]
323+
- `t` indicates that the resource has the [test capability][09]
324+
- `d` indicates that the resource has the [delete capability][10]
325+
- `e` indicates that the resource has the [export capability][11]
326+
- `r` indicates that the resource has the [resolve capability][12]
327327

328328
For example, the `Microsoft.Windows/Registry` resource has the following capabilities: `gs--d-`,
329-
indicating it has the `Get`, `Set`, and `Delete` capabilities.
329+
indicating it has the `get`, `set`, and `delete` capabilities.
330330
- **RequireAdapter** - The fully qualified type name of the adapter resource that DSC uses to
331331
invoke the returned resource.
332332
- **Description** - The short description of the resource's purpose and usage.

docs/reference/cli/schema/command.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Command line reference for the 'dsc schema' command
3-
ms.date: 06/24/2024
3+
ms.date: 02/28/2025
44
ms.topic: reference
55
title: dsc schema
66
---
@@ -26,6 +26,22 @@ integrating tool.
2626
The application uses these schemas to validate data internally when it's received or represent the
2727
output for one of the application's commands.
2828

29+
> [!NOTE]
30+
> Currently, the schemas returned by the `dsc schema` command and those published to GitHub are
31+
> not the same. The published schemas more fully describe and validate the data than the schemas
32+
> emitted by the command. The DSC team is working to canonicalize the schemas returned from the
33+
> command.
34+
>
35+
> Both the published schemas and those returned from this command correctly validate the data. The
36+
> schemas returned from this command are less strict than the published schemas. Even though data
37+
> validates against the schemas returned by this command, DSC may raise errors when processing the
38+
> data. For example, the returned schema for versions indicates that the valid value is a string -
39+
> but if you specify a string that isn't a semantic version, DSC raises an error. In that case, the
40+
> data passed the schema validation but was incorrect.
41+
>
42+
> Until the schemas are canonicalized, consider using the published schemas when indpendently
43+
> testing your configuration documents and resource manifests with a JSON Schema validation tool.
44+
2945
## Examples
3046

3147
### Example 1 - Retrieve the schema for the dsc resource get command result

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/config/functions/add.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Reference for the 'add' DSC configuration document function
3-
ms.date: 03/19/2024
3+
ms.date: 02/28/2025
44
ms.topic: reference
55
title: add
66
---
@@ -30,7 +30,7 @@ This example document shows how you can use the `add()` function to return the s
3030

3131
```yaml
3232
# add.example.1.dsc.config.yaml
33-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
33+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
3434
resources:
3535
- name: Sum of 3 and 5
3636
type: Test/Echo
@@ -60,7 +60,7 @@ configuration functions that return integer values.
6060

6161
```yaml
6262
# add.example.2.dsc.config.yaml
63-
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
63+
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
6464
resources:
6565
- name: Add nested function outputs
6666
type: Test/Echo

0 commit comments

Comments
 (0)