Skip to content

Commit 2c75ef0

Browse files
committed
simplify environment variable schema
1 parent c4b13ef commit 2c75ef0

File tree

2 files changed

+63
-143
lines changed

2 files changed

+63
-143
lines changed

schemas/bashly.json

Lines changed: 39 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,44 @@
281281
},
282282
"additionalProperties": false
283283
},
284+
"environment-variable": {
285+
"title": "environment variable",
286+
"description": "An environment variable of the current application\nhttps://bashly.dannyb.co/configuration/environment-variable/#environment-variable",
287+
"type": "object",
288+
"required": [
289+
"name"
290+
],
291+
"properties": {
292+
"name": {
293+
"$ref": "#/definitions/environment-variables-name-property"
294+
},
295+
"help": {
296+
"$ref": "#/definitions/environment-variables-help-property"
297+
},
298+
"private": {
299+
"$ref": "#/definitions/environment-variables-private-property"
300+
},
301+
"required": {
302+
"$ref": "#/definitions/environment-variables-required-property"
303+
},
304+
"allowed": {
305+
"$ref": "#/definitions/environment-variables-allowed-property"
306+
},
307+
"default": {
308+
"$ref": "#/definitions/environment-variables-default-property"
309+
}
310+
},
311+
"patternProperties": {
312+
"^x_.": {
313+
"title": "custom property",
314+
"description": "A custom property of any type",
315+
"examples": [
316+
"Anything"
317+
]
318+
}
319+
},
320+
"additionalProperties": false
321+
},
284322
"name-property": {
285323
"title": "name",
286324
"description": "A name of the current script or sub-command\nhttps://bashly.dannyb.co/configuration/command/#name",
@@ -442,97 +480,7 @@
442480
"type": "array",
443481
"uniqueItems": true,
444482
"items": {
445-
"title": "environment variable",
446-
"description": "An environment variable of the current application\nhttps://bashly.dannyb.co/configuration/environment-variable/#environment-variable",
447-
"type": "object",
448-
"required": [
449-
"name"
450-
],
451-
"properties": {
452-
"name": {
453-
"$ref": "#/definitions/environment-variables-name-property"
454-
},
455-
"help": {
456-
"$ref": "#/definitions/environment-variables-help-property"
457-
},
458-
"default": {
459-
"$ref": "#/definitions/environment-variables-default-property"
460-
},
461-
"private": {
462-
"$ref": "#/definitions/environment-variables-private-property"
463-
},
464-
"required": {
465-
"$ref": "#/definitions/environment-variables-required-property"
466-
},
467-
"allowed": {
468-
"$ref": "#/definitions/environment-variables-allowed-property"
469-
}
470-
},
471-
"if": {
472-
"properties": {
473-
"required": {
474-
"const": false
475-
}
476-
}
477-
},
478-
"then": {
479-
"properties": {
480-
"name": {
481-
"$ref": "#/definitions/environment-variables-name-property"
482-
},
483-
"help": {
484-
"$ref": "#/definitions/environment-variables-help-property"
485-
},
486-
"default": {
487-
"$ref": "#/definitions/environment-variables-default-property"
488-
},
489-
"private": {
490-
"$ref": "#/definitions/environment-variables-private-property"
491-
},
492-
"required": {
493-
"$ref": "#/definitions/environment-variables-required-property"
494-
},
495-
"allowed": {
496-
"$ref": "#/definitions/environment-variables-allowed-property"
497-
}
498-
},
499-
"patternProperties": {
500-
"^x_.": {
501-
"title": "custom property",
502-
"description": "A custom property of any type",
503-
"examples": [
504-
"Anything"
505-
]
506-
}
507-
},
508-
"additionalProperties": false
509-
},
510-
"else": {
511-
"properties": {
512-
"name": {
513-
"$ref": "#/definitions/environment-variables-name-property"
514-
},
515-
"help": {
516-
"$ref": "#/definitions/environment-variables-help-property"
517-
},
518-
"private": {
519-
"$ref": "#/definitions/environment-variables-private-property"
520-
},
521-
"required": {
522-
"$ref": "#/definitions/environment-variables-required-property"
523-
}
524-
},
525-
"patternProperties": {
526-
"^x_.": {
527-
"title": "custom property",
528-
"description": "A custom property of any type",
529-
"examples": [
530-
"Anything"
531-
]
532-
}
533-
},
534-
"additionalProperties": false
535-
}
483+
"$ref": "#/definitions/environment-variable"
536484
}
537485
},
538486
"examples-property": {

support/schema/bashly.yml

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,29 @@ definitions:
245245
const: true
246246
patternProperties: *custom-properties
247247
additionalProperties: false
248+
environment-variable:
249+
title: environment variable
250+
description: |-
251+
An environment variable of the current application
252+
https://bashly.dannyb.co/configuration/environment-variable/#environment-variable
253+
type: object
254+
required:
255+
- name
256+
properties:
257+
name:
258+
$ref: '#/definitions/environment-variables-name-property'
259+
help:
260+
$ref: '#/definitions/environment-variables-help-property'
261+
private:
262+
$ref: '#/definitions/environment-variables-private-property'
263+
required:
264+
$ref: '#/definitions/environment-variables-required-property'
265+
allowed:
266+
$ref: '#/definitions/environment-variables-allowed-property'
267+
default:
268+
$ref: '#/definitions/environment-variables-default-property'
269+
patternProperties: *custom-properties
270+
additionalProperties: false
248271
name-property:
249272
title: name
250273
description: |-
@@ -399,58 +422,7 @@ definitions:
399422
type: array
400423
uniqueItems: true
401424
items:
402-
title: environment variable
403-
description: |-
404-
An environment variable of the current application
405-
https://bashly.dannyb.co/configuration/environment-variable/#environment-variable
406-
type: object
407-
required:
408-
- name
409-
properties:
410-
name:
411-
$ref: '#/definitions/environment-variables-name-property'
412-
help:
413-
$ref: '#/definitions/environment-variables-help-property'
414-
default:
415-
$ref: '#/definitions/environment-variables-default-property'
416-
private:
417-
$ref: '#/definitions/environment-variables-private-property'
418-
required:
419-
$ref: '#/definitions/environment-variables-required-property'
420-
allowed:
421-
$ref: '#/definitions/environment-variables-allowed-property'
422-
if:
423-
properties:
424-
required:
425-
const: false
426-
then:
427-
properties:
428-
name:
429-
$ref: '#/definitions/environment-variables-name-property'
430-
help:
431-
$ref: '#/definitions/environment-variables-help-property'
432-
default:
433-
$ref: '#/definitions/environment-variables-default-property'
434-
private:
435-
$ref: '#/definitions/environment-variables-private-property'
436-
required:
437-
$ref: '#/definitions/environment-variables-required-property'
438-
allowed:
439-
$ref: '#/definitions/environment-variables-allowed-property'
440-
patternProperties: *custom-properties
441-
additionalProperties: false
442-
else:
443-
properties:
444-
name:
445-
$ref: '#/definitions/environment-variables-name-property'
446-
help:
447-
$ref: '#/definitions/environment-variables-help-property'
448-
private:
449-
$ref: '#/definitions/environment-variables-private-property'
450-
required:
451-
$ref: '#/definitions/environment-variables-required-property'
452-
patternProperties: *custom-properties
453-
additionalProperties: false
425+
$ref: '#/definitions/environment-variable'
454426
examples-property:
455427
title: examples
456428
oneOf:

0 commit comments

Comments
 (0)