Skip to content

Commit 91a8a67

Browse files
(GH-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 #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 91d59fb commit 91a8a67

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 398 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 617 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 333 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 368 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 349 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 384 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 355 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 390 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 130 additions & 0 deletions
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+
}

0 commit comments

Comments
 (0)