Skip to content

Commit 91d59fb

Browse files
(GH-642) Update schema source definitions
This change updates the YAML source definition files for the JSON Schemas to use the correct casing. It also adds the missing `context` property for the `Microsoft.DSC` metadata field.
1 parent ce2e266 commit 91d59fb

File tree

8 files changed

+55
-31
lines changed

8 files changed

+55
-31
lines changed

schemas/src/definitions/message.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ properties:
3333
Indicates the severity of the message.
3434
type: string
3535
enum:
36-
- Error
37-
- Warning
38-
- Information
36+
- error
37+
- warning
38+
- information
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# yaml-language-server: $schema=https://json-schema.org/draft/2020-12/schema
2+
$schema: https://json-schema.org/draft/2020-12/schema
3+
$id: <HOST>/<PREFIX>/<VERSION>/metadata/Microsoft.DSC/context.yaml
4+
# Documentation
5+
title: Operation context
6+
description: >-
7+
Defines whether the operation was for a configuration or a resource. If the value for this
8+
metadata property is `configuration`, DSC was run through the `dsc config` command. If the value
9+
is `resource`, DSC was run with the `dsc resource` command.
10+
11+
markdownDescription: |-
12+
Defines whether the operation was for a configuration or a resource. If the value for this
13+
metadata property is `configuration`, DSC was run through the `dsc config` command. If the value
14+
is `resource`, DSC was run with the `dsc resource` command.
15+
# Definition
16+
type: string
17+
enum:
18+
- resource
19+
- configuration

schemas/src/metadata/Microsoft.DSC/executionType.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ markdownDescription: |-
1414
# Definition
1515
type: string
1616
enum:
17-
- Actual
18-
- WhatIf
17+
- actual
18+
- whatIf

schemas/src/metadata/Microsoft.DSC/operation.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ markdownDescription: |-
1212
# Definition
1313
type: string
1414
enum:
15-
- Get
16-
- Set
17-
- Test
18-
- Export
15+
- get
16+
- set
17+
- test
18+
- export

schemas/src/metadata/Microsoft.DSC/securityContext.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ $id: <HOST>/<PREFIX>/<VERSION>/metadata/Microsoft.DSC/securityContext.yaml
55
title: Security context
66
description: >-
77
Defines the security context that DSC was run under. If the value for this metadata property is
8-
`Elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator
9-
privileges (on Windows). If the value is `Restricted`, DSC was run as a normal user or account in
8+
`elevated`, DSC was run as root (non-Windows) or an elevated session with Administrator
9+
privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in
1010
a non-elevated session.
1111
markdownDescription: |-
1212
Defines the security context that DSC was run under. If the value for this metadata property is
13-
`Elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator
14-
privileges (on Windows). If the value is `Restricted`, DSC was run as a normal user or account in
13+
`elevated`, DSC was run as `root` (non-Windows) or an elevated session with Administrator
14+
privileges (on Windows). If the value is `restricted`, DSC was run as a normal user or account in
1515
a non-elevated session.
1616
# Definition
1717
type: string
1818
enum:
19-
- Current
20-
- Elevated
21-
- Restricted
19+
- current
20+
- elevated
21+
- restricted

schemas/src/metadata/configurationDocumentResult.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ properties:
3030
- endDatetime
3131
- duration
3232
- securityContext
33+
- context
3334
properties:
3435
version:
3536
$ref: /<PREFIX>/<VERSION>/metadata/Microsoft.DSC/version.yaml
@@ -45,3 +46,5 @@ properties:
4546
$ref: /<PREFIX>/<VERSION>/metadata/Microsoft.DSC/duration.yaml
4647
securityContext:
4748
$ref: /<PREFIX>/<VERSION>/metadata/Microsoft.DSC/securityContext.yaml
49+
context:
50+
$ref: /<PREFIX>/<VERSION>/metadata/Microsoft.DSC/context.yaml

schemas/src/outputs/resource/list.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ properties:
2424
title: Resource capabilities
2525
description: >-
2626
Defines the list of DSC operations the resource is compatible with. If the resource doesn't
27-
list a given operation, like `Set` or `Export`, the resource can't be used for those
28-
operations. The exception to this is `Test` - DSC uses synthetic testing for resources that
29-
don't have the `Test` capability.
27+
list a given operation, like `set` or `export`, the resource can't be used for those
28+
operations. The exception to this is `test` - DSC uses synthetic testing for resources that
29+
don't have the `test` capability.
3030
type: array
3131
items:
3232
type: string
3333
enum:
34-
- Get
35-
- Set
36-
- SetHandlesExist
37-
- WhatIf
38-
- Test
39-
- Delete
40-
- Export
41-
- Resolve
34+
- get
35+
- set
36+
- setHandlesExist
37+
- whatIf
38+
- test
39+
- delete
40+
- export
41+
- resolve
4242
description:
4343
title: Resource Description
4444
description: >-
@@ -69,7 +69,7 @@ properties:
6969
implementations built into DSC.
7070
type: string
7171
enum:
72-
- Command
72+
- command
7373

7474
# Need to understand how this works to document it more usefully
7575
- title: Custom implementation

schemas/src/resource/manifest.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ defaultSnippets:
6060
body:
6161
${escape_dollar:$}schema: <HOST>/<PREFIX>/<VERSION>/bundled/resource/manifest.yaml
6262
type: '${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\.]dsc[\.]resource/$1/}}'
63+
kind: group
6364
version: '${3:0.1.0}'
6465
description: ${4:Synopsis for the resource's purpose}
6566
get:
@@ -100,6 +101,7 @@ defaultSnippets:
100101
body:
101102
${escape_dollar:$}schema: <HOST>/<PREFIX>/<VERSION>/bundled/resource/manifest.yaml
102103
type: '${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\.]dsc[\.]resource/$1/}}'
104+
kind: adapter
103105
version: '${3:0.1.0}'
104106
description: ${4:Synopsis for the resource's purpose}
105107
get:
@@ -145,7 +147,7 @@ defaultSnippets:
145147
body:
146148
${escape_dollar:$}schema: <HOST>/<PREFIX>/<VERSION>/bundled/resource/manifest.yaml
147149
type: '${1:owner.area.group}/${2:${TM_FILENAME_BASE/^(.*?)[\.]dsc[\.]resource/$1/}}'
148-
kind: Import
150+
kind: importer
149151
version: '${3:0.1.0}'
150152
description: ${4:Synopsis for the resource's purpose}
151153
resolve:
@@ -519,13 +521,13 @@ properties:
519521
allOf:
520522
# Adapter resources must define the adapter command
521523
- if:
522-
properties: { kind: { const: Adapter } }
524+
properties: { kind: { const: adapter } }
523525
required: [kind]
524526
then:
525527
required: [adapter]
526528
# Importer resources must define resolve, all others must define get
527529
- if:
528-
properties: { kind: { const: Import } }
530+
properties: { kind: { const: importer } }
529531
required: [kind]
530532
then:
531533
required: [resolve]

0 commit comments

Comments
 (0)