Skip to content

Commit c8c9100

Browse files
committed
schema: Move info about $defs into README
Turns out $comment is not allowed there according to another schema meta-validator.
1 parent d465b61 commit c8c9100

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

config/schemas/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ EOF
8585

8686
The output can be tweaked and inserted into `config/schemas/config.yaml` under `.properties`.
8787

88+
To limit duplication, common properties that are used in many places can be placed under `.$defs` and referenced via `$ref: '#/$defs/thing'`
89+
90+
```yaml
91+
$defs:
92+
common:
93+
title: Some Common Thing
94+
service:
95+
title: The Service
96+
common:
97+
$ref: '#/$defs/common'
98+
```
99+
88100
## VSCode
89101
90102
The plugin `redhat.vscode-yaml` can provide auto completion, validation and help texts from the schema.

config/schemas/config.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ description: |
77
cluster and the workload cluster, but keep in mind that each configuration
88
file will contain different settings.
99
$defs:
10-
$comment: |
11-
Location for common types of things for reuse with a reference like
12-
13-
```yaml
14-
thing:
15-
$ref: "#/$defs/thing"
16-
```
1710
kubernetesAffinity:
1811
$comment: Real k8s resources might have existing schemas that could be reused as-is
1912
properties:

0 commit comments

Comments
 (0)