Skip to content

Commit d86b7e4

Browse files
michaeltlombardiSteveL-MSFT
authored andcommitted
(PowerShellGH-642) Generate schemas from source for v3.0
This change generates the canonical schemas for in new folders: `v3`, `v3.0`, and `v3.0.0`, instead of the previous date-based folder `2024/04`. The changing of the casing is _not_ backwards compatible, and requires a new location to avoid breaking prior schemas. This change generates the schemas into three folders to accomodate the changes requested in PowerShell#138 for moving from date-based to semantic versioning for the schemas. Going forward, schema generation should: - Export to a folder for the current release with the full semantic version, like `v3.0.1` or `v3.1.0`. - Export to a folder for the current `major.minor` schema, like `v3.0` or `v3.1` - Build to a folder for the current major version of the release, like `v3`. Under this design, you can: - Get the exact version of the schema that a release shipped with by specifying the schema URI as `v<major>.<minor>.<patch>` - Get the latest schema for your minor version as `v<major>.<minor>` - Get the latest schema for your major version as `v<major>` Breaking changes to the schema have the potential to break integrating software, configuration documents, and resource manifests. They therefore constitute a breaking change in the application and require incrementing the major version segment of the semantic version. This change will be followed by an update to the allowed schema versions in the code itself, which should only recognize the updated schema at this time, not previous schemas.
1 parent 3c2e324 commit d86b7e4

File tree

238 files changed

+38110
-1
lines changed

Some content is hidden

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

238 files changed

+38110
-1
lines changed

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: 2024/04
3+
version: v3.0
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/v3.0.0/bundled/config/document.json

+398
Large diffs are not rendered by default.

schemas/v3.0.0/bundled/config/document.vscode.json

+617
Large diffs are not rendered by default.

schemas/v3.0.0/bundled/outputs/config/get.json

+333
Large diffs are not rendered by default.

schemas/v3.0.0/bundled/outputs/config/get.vscode.json

+368
Large diffs are not rendered by default.

schemas/v3.0.0/bundled/outputs/config/set.json

+349
Large diffs are not rendered by default.

schemas/v3.0.0/bundled/outputs/config/set.vscode.json

+384
Large diffs are not rendered by default.

schemas/v3.0.0/bundled/outputs/config/test.json

+355
Large diffs are not rendered by default.

schemas/v3.0.0/bundled/outputs/config/test.vscode.json

+390
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json",
4+
"title": "dsc resource get result",
5+
"description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.",
6+
"anyOf": [
7+
{
8+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json"
9+
},
10+
{
11+
"type": "array",
12+
"items": {
13+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json"
14+
}
15+
}
16+
],
17+
"$defs": {
18+
"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json": {
19+
"$schema": "https://json-schema.org/draft/2020-12/schema",
20+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json",
21+
"title": "dsc resource get result (simple)",
22+
"description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.",
23+
"type": "object",
24+
"required": [
25+
"actualState"
26+
],
27+
"properties": {
28+
"actualState": {
29+
"title": "Actual state",
30+
"description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.",
31+
"type": "object"
32+
}
33+
}
34+
},
35+
"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json": {
36+
"$schema": "https://json-schema.org/draft/2020-12/schema",
37+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json",
38+
"title": "dsc resource get result (full)",
39+
"description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.",
40+
"type": "object",
41+
"required": [
42+
"metadata",
43+
"name",
44+
"result",
45+
"type"
46+
],
47+
"properties": {
48+
"metadata": {
49+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json"
50+
},
51+
"name": {
52+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json"
53+
},
54+
"type": {
55+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json"
56+
},
57+
"result": {
58+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json"
59+
}
60+
}
61+
},
62+
"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json": {
63+
"$schema": "https://json-schema.org/draft/2020-12/schema",
64+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json",
65+
"title": "Resource instance result metadata",
66+
"description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.",
67+
"type": "object",
68+
"required": [
69+
"Microsoft.DSC"
70+
],
71+
"properties": {
72+
"Microsoft.DSC": {
73+
"title": "DSC context metadata",
74+
"description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.",
75+
"type": "object",
76+
"required": [
77+
"duration"
78+
],
79+
"properties": {
80+
"duration": {
81+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json"
82+
}
83+
}
84+
}
85+
}
86+
},
87+
"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json": {
88+
"$schema": "https://json-schema.org/draft/2020-12/schema",
89+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json",
90+
"title": "Instance name",
91+
"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.",
92+
"type": "string",
93+
"pattern": "^[a-zA-Z0-9 ]+$",
94+
"minLength": 1
95+
},
96+
"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json": {
97+
"$schema": "https://json-schema.org/draft/2020-12/schema",
98+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json",
99+
"title": "DSC Resource fully qualified type name",
100+
"description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n",
101+
"type": "string",
102+
"pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$"
103+
},
104+
"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json": {
105+
"$schema": "https://json-schema.org/draft/2020-12/schema",
106+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json",
107+
"title": "dsc resource get result",
108+
"description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.",
109+
"anyOf": [
110+
{
111+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json"
112+
},
113+
{
114+
"type": "array",
115+
"items": {
116+
"$ref": "/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json"
117+
}
118+
}
119+
]
120+
},
121+
"https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json": {
122+
"$schema": "https://json-schema.org/draft/2020-12/schema",
123+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json",
124+
"title": "Duration",
125+
"description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A",
126+
"type": "string",
127+
"format": "duration"
128+
}
129+
}
130+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json",
4+
"title": "dsc resource get result",
5+
"description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.",
6+
"anyOf": [
7+
{
8+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json"
9+
},
10+
{
11+
"type": "array",
12+
"items": {
13+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json"
14+
}
15+
}
16+
],
17+
"$defs": {
18+
"PowerShell": {
19+
"DSC": {
20+
"main": {
21+
"schemas": {
22+
"v3.0.0": {
23+
"outputs": {
24+
"resource": {
25+
"get.simple.json": {
26+
"$schema": "https://json-schema.org/draft/2020-12/schema",
27+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json",
28+
"title": "dsc resource get result (simple)",
29+
"description": "Describes the return data for a single DSC Resource instance from the `dsc resource get` command. This data is returned for instances that aren't group resources, adapter resources, or nested inside a group or adapter resource.\nWhen you use `dsc resource get` for a group or adapter resource, the command returns an array of full test result objects that include the name and type for the nested instances.",
30+
"type": "object",
31+
"required": [
32+
"actualState"
33+
],
34+
"properties": {
35+
"actualState": {
36+
"title": "Actual state",
37+
"description": "This property always represents the current state of the DSC Resource instance as returned by its `get` method. DSC validates this return value against the DSC Resource's schema.",
38+
"type": "object"
39+
}
40+
}
41+
},
42+
"get.full.json": {
43+
"$schema": "https://json-schema.org/draft/2020-12/schema",
44+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json",
45+
"title": "dsc resource get result (full)",
46+
"description": "Describes the return data for the full result of the `get` operation for a\nresource instance. This data is returned:\n\n- For every instance in a configuration document when you use the\n `dsc config get` command.\n\n- For nested instances of a group or adapter resource when you use the\n `dsc resource get` command.",
47+
"type": "object",
48+
"required": [
49+
"metadata",
50+
"name",
51+
"result",
52+
"type"
53+
],
54+
"properties": {
55+
"metadata": {
56+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json"
57+
},
58+
"name": {
59+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json"
60+
},
61+
"type": {
62+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json"
63+
},
64+
"result": {
65+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json"
66+
}
67+
}
68+
},
69+
"get.json": {
70+
"$schema": "https://json-schema.org/draft/2020-12/schema",
71+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.json",
72+
"title": "dsc resource get result",
73+
"description": "Describes the return data for a DSC Resource instance from the `dsc resource get` command. The return data is either a single object that describes the actual state of a non-nested instance or an array of objects that describe the actual state of the nested instances for a group or adapter resource.",
74+
"anyOf": [
75+
{
76+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.simple.json"
77+
},
78+
{
79+
"type": "array",
80+
"items": {
81+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/outputs/resource/get.full.json"
82+
}
83+
}
84+
]
85+
}
86+
}
87+
},
88+
"metadata": {
89+
"resourceInstanceResult.json": {
90+
"$schema": "https://json-schema.org/draft/2020-12/schema",
91+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/resourceInstanceResult.json",
92+
"title": "Resource instance result metadata",
93+
"description": "Defines metadata DSC returns for a DSC configuration operation against a resource instance in a configuration document, as from the `dsc config get` or `dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe the context of the operation.",
94+
"markdownDescription": "Defines metadata DSC returns for a configuration operation, as from the `dsc config get` or\n`dsc config set` commands. The metadata properties under the `Microsoft.DSC` property describe\nthe context of the operation.",
95+
"type": "object",
96+
"required": [
97+
"Microsoft.DSC"
98+
],
99+
"properties": {
100+
"Microsoft.DSC": {
101+
"title": "DSC context metadata",
102+
"description": "The child properties for this metadata describe the context of the DSC operation against a resource instance, including the duration of the operation.",
103+
"type": "object",
104+
"required": [
105+
"duration"
106+
],
107+
"properties": {
108+
"duration": {
109+
"$ref": "#/$defs/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json"
110+
}
111+
}
112+
}
113+
}
114+
},
115+
"Microsoft.DSC": {
116+
"duration.json": {
117+
"$schema": "https://json-schema.org/draft/2020-12/schema",
118+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/metadata/Microsoft.DSC/duration.json",
119+
"title": "Duration",
120+
"description": "Defines the duration of a DSC operation against a configuration document or resource instance as a string following the format defined in ISO8601 ABNF for `duration`. For example, `PT0.611216S` represents a duration of about `0.61` seconds. For more information, see: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A",
121+
"markdownDescription": "Defines the duration of a DSC operation against a configuration document or resource instance as\na string following the format defined in [ISO8601 ABNF for `duration`][01]. For example,\n`PT0.611216S` represents a duration of about `0.61` seconds.\n\n[01]: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A",
122+
"type": "string",
123+
"format": "duration"
124+
}
125+
}
126+
},
127+
"definitions": {
128+
"instanceName.json": {
129+
"$schema": "https://json-schema.org/draft/2020-12/schema",
130+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/instanceName.json",
131+
"title": "Instance name",
132+
"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.",
133+
"type": "string",
134+
"pattern": "^[a-zA-Z0-9 ]+$",
135+
"minLength": 1,
136+
"patternErrorMessage": "Invalid value for instance name. An instance name must be a non-empty string containing only\nletters, numbers, and spaces.\n",
137+
"markdownDescription": "***\n[_Online Documentation_][01]\n***\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&preserve-view=true#name\n"
138+
},
139+
"resourceType.json": {
140+
"$schema": "https://json-schema.org/draft/2020-12/schema",
141+
"$id": "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/definitions/resourceType.json",
142+
"title": "DSC Resource fully qualified type name",
143+
"description": "The namespaced name of the DSC Resource, using the syntax:\n\nowner[.group][.area]/name\n\nFor example:\n\n - Microsoft.SqlServer/Database\n - Microsoft.SqlServer.Database/User\n",
144+
"type": "string",
145+
"pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$",
146+
"markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nThe namespaced name of the DSC Resource, using the syntax:\n\n```yaml\nowner[.group][.area]/name\n```\n\nFor example:\n\n- `Microsoft.SqlServer/Database`\n- `Microsoft.SqlServer.Database/User`\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/definitions/resourcetype?view=dsc-3.0&preserve-view=true\n",
147+
"patternErrorMessage": "Invalid type name. Valid resource type names always define an owner and a name separated by a\nslash, like `Microsoft/OSInfo`. Type names may optionally include a group and area to namespace\nthe resource under the owner, like `Microsoft.Windows/Registry`.\n"
148+
}
149+
}
150+
}
151+
}
152+
}
153+
}
154+
}
155+
}
156+
}

0 commit comments

Comments
 (0)