Skip to content

Commit 564556d

Browse files
EmilySeville7cfgEmilySeville7cfg
authored andcommitted
feat(schema): enhance custom prop definition
1 parent 1fb25d3 commit 564556d

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

schemas/bashly.json

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"definitions": {
4+
"custom-properties": {
5+
"patternProperties": {
6+
"^x-.": {
7+
"title": "custom property",
8+
"description": "A custom property",
9+
"examples": [
10+
"hello"
11+
]
12+
}
13+
}
14+
},
415
"argument": {
516
"title": "argument",
617
"description": "A positional argument of the current script or sub-command\nhttps://bashly.dannyb.co/configuration/argument/",
@@ -74,8 +85,8 @@
7485
]
7586
}
7687
},
77-
"additionalProperties": false,
78-
"patternProperties": { "^x-.": {} }
88+
"$ref": "#/definitions/custom-properties",
89+
"additionalProperties": false
7990
},
8091
"flag": {
8192
"title": "flag",
@@ -210,8 +221,8 @@
210221
]
211222
}
212223
},
213-
"additionalProperties": false,
214-
"patternProperties": { "^x-.": {} }
224+
"$ref": "#/definitions/custom-properties",
225+
"additionalProperties": false
215226
},
216227
"name-property": {
217228
"title": "name",
@@ -407,8 +418,8 @@
407418
"$ref": "#/definitions/environment-variables-required-property"
408419
}
409420
},
410-
"additionalProperties": false,
411-
"patternProperties": { "^x-.": {} }
421+
"$ref": "#/definitions/custom-properties",
422+
"additionalProperties": false
412423
},
413424
"else": {
414425
"properties": {
@@ -425,8 +436,8 @@
425436
"$ref": "#/definitions/environment-variables-required-property"
426437
}
427438
},
428-
"additionalProperties": false,
429-
"patternProperties": { "^x-.": {} }
439+
"$ref": "#/definitions/custom-properties",
440+
"additionalProperties": false
430441
}
431442
}
432443
},
@@ -783,8 +794,8 @@
783794
"$ref": "#/definitions/sub-command-import-property"
784795
}
785796
},
786-
"additionalProperties": false,
787-
"patternProperties": { "^x-.": {} }
797+
"$ref": "#/definitions/custom-properties",
798+
"additionalProperties": false
788799
}
789800
},
790801
"title": "cli",
@@ -840,6 +851,6 @@
840851
"$ref": "#/definitions/function-property"
841852
}
842853
},
843-
"additionalProperties": false,
844-
"patternProperties": { "^x-.": {} }
854+
"$ref": "#/definitions/custom-properties",
855+
"additionalProperties": false
845856
}

0 commit comments

Comments
 (0)