Skip to content

Commit d0f9b44

Browse files
authored
Merge pull request #366 from dellison/master
update readme with example of an array of glob patterns for schema
2 parents 373a981 + df9a71a commit d0f9b44

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,42 @@ Since `0.11.0` YAML Schemas can be used for validation:
153153
"/home/user/custom_schema.yaml": "someFilePattern.yaml"
154154
```
155155

156+
A schema can be associated with multiple globs using a json array, e.g.
157+
158+
```json
159+
yaml.schemas: {
160+
"kubernetes": ["filePattern1.yaml", "filePattern2.yaml"]
161+
}
162+
```
163+
164+
e.g.
165+
166+
```json
167+
"yaml.schemas": {
168+
"http://json.schemastore.org/composer": ["/*"],
169+
"file:///home/johnd/some-schema.json": ["some.yaml"],
170+
"../relative/path/schema.json": ["/config*.yaml"],
171+
"/Users/johnd/some-schema.json": ["some.yaml"],
172+
}
173+
```
174+
175+
e.g.
176+
177+
```json
178+
"yaml.schemas": {
179+
"kubernetes": ["/myYamlFile.yaml"]
180+
}
181+
```
182+
183+
e.g.
184+
185+
```json
186+
"yaml.schemas": {
187+
"http://json.schemastore.org/composer": ["/*"],
188+
"kubernetes": ["/myYamlFile.yaml"]
189+
}
190+
```
191+
156192
#### Multi root schema association:
157193

158194
You can also use relative paths when working with multi root workspaces.

0 commit comments

Comments
 (0)