Skip to content

Commit 7837076

Browse files
authored
Merge pull request #476 from DannyBen/refactor/schema
Refactor `environment_variable` in schema
2 parents 2bcc8a3 + 1568377 commit 7837076

File tree

2 files changed

+89
-121
lines changed

2 files changed

+89
-121
lines changed

schemas/bashly.json

Lines changed: 41 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -290,22 +290,57 @@
290290
],
291291
"properties": {
292292
"name": {
293-
"$ref": "#/definitions/environment-variables-name-property"
293+
"title": "name",
294+
"description": "A name of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#name",
295+
"type": "string",
296+
"minLength": 1,
297+
"examples": [
298+
"config_path"
299+
]
294300
},
295301
"help": {
296-
"$ref": "#/definitions/environment-variables-help-property"
302+
"title": "help",
303+
"description": "A description of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#help",
304+
"type": "string",
305+
"minLength": 1,
306+
"examples": [
307+
"Location of the config file"
308+
]
297309
},
298310
"private": {
299-
"$ref": "#/definitions/environment-variables-private-property"
311+
"title": "private",
312+
"description": "Whether the current environment variable is hidden from help\nhttps://bashly.dannyb.co/configuration/environment-variable/#private",
313+
"type": "boolean",
314+
"default": false
300315
},
301316
"required": {
302-
"$ref": "#/definitions/environment-variables-required-property"
317+
"title": "required",
318+
"description": "Whether the current environment variable is required\nhttps://bashly.dannyb.co/configuration/environment-variable/#required",
319+
"type": "boolean",
320+
"default": true
303321
},
304322
"allowed": {
305-
"$ref": "#/definitions/environment-variables-allowed-property"
323+
"title": "allowed",
324+
"description": "Valid values of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#allowed",
325+
"type": "array",
326+
"minLength": 1,
327+
"uniqueItems": true,
328+
"items": {
329+
"description": "A valid value of the current environment variable",
330+
"type": "string",
331+
"minLength": 1,
332+
"examples": [
333+
"production"
334+
]
335+
}
306336
},
307337
"default": {
308-
"$ref": "#/definitions/environment-variables-default-property"
338+
"title": "default",
339+
"description": "A default value of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#default",
340+
"type": "string",
341+
"examples": [
342+
"~/config.ini"
343+
]
309344
}
310345
},
311346
"patternProperties": {
@@ -420,60 +455,6 @@
420455
}
421456
]
422457
},
423-
"environment-variables-name-property": {
424-
"$comment": "'environment-variables-' prefix is used as this property is related to https://bashly.dannyb.co/configuration/environment-variable/#environment-variable",
425-
"title": "name",
426-
"description": "A name of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#name",
427-
"type": "string",
428-
"minLength": 1,
429-
"examples": [
430-
"config_path"
431-
]
432-
},
433-
"environment-variables-help-property": {
434-
"title": "help",
435-
"description": "A description of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#help",
436-
"type": "string",
437-
"minLength": 1,
438-
"examples": [
439-
"Location of the config file"
440-
]
441-
},
442-
"environment-variables-default-property": {
443-
"title": "default",
444-
"description": "A default value of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#default",
445-
"type": "string",
446-
"examples": [
447-
"~/config.ini"
448-
]
449-
},
450-
"environment-variables-private-property": {
451-
"title": "private",
452-
"description": "Whether the current environment variable is hidden from help\nhttps://bashly.dannyb.co/configuration/environment-variable/#private",
453-
"type": "boolean",
454-
"default": false
455-
},
456-
"environment-variables-required-property": {
457-
"title": "required",
458-
"description": "Whether the current environment variable is required\nhttps://bashly.dannyb.co/configuration/environment-variable/#required",
459-
"type": "boolean",
460-
"default": true
461-
},
462-
"environment-variables-allowed-property": {
463-
"title": "allowed",
464-
"description": "Valid values of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#allowed",
465-
"type": "array",
466-
"minLength": 1,
467-
"uniqueItems": true,
468-
"items": {
469-
"description": "A valid value of the current environment variable",
470-
"type": "string",
471-
"minLength": 1,
472-
"examples": [
473-
"production"
474-
]
475-
}
476-
},
477458
"environment-variables-property": {
478459
"title": "environment variables",
479460
"description": "Environment variables of the current application\nhttps://bashly.dannyb.co/configuration/environment-variable/#environment-variable",

support/schema/bashly.yml

Lines changed: 48 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,59 @@ definitions:
255255
- name
256256
properties:
257257
name:
258-
$ref: '#/definitions/environment-variables-name-property'
258+
title: name
259+
description: |-
260+
A name of the current environment variable
261+
https://bashly.dannyb.co/configuration/environment-variable/#name
262+
type: string
263+
minLength: 1
264+
examples:
265+
- config_path
259266
help:
260-
$ref: '#/definitions/environment-variables-help-property'
267+
title: help
268+
description: |-
269+
A description of the current environment variable
270+
https://bashly.dannyb.co/configuration/environment-variable/#help
271+
type: string
272+
minLength: 1
273+
examples:
274+
- Location of the config file
261275
private:
262-
$ref: '#/definitions/environment-variables-private-property'
276+
title: private
277+
description: |-
278+
Whether the current environment variable is hidden from help
279+
https://bashly.dannyb.co/configuration/environment-variable/#private
280+
type: boolean
281+
default: false
263282
required:
264-
$ref: '#/definitions/environment-variables-required-property'
283+
title: required
284+
description: |-
285+
Whether the current environment variable is required
286+
https://bashly.dannyb.co/configuration/environment-variable/#required
287+
type: boolean
288+
default: true
265289
allowed:
266-
$ref: '#/definitions/environment-variables-allowed-property'
290+
title: allowed
291+
description: |-
292+
Valid values of the current environment variable
293+
https://bashly.dannyb.co/configuration/environment-variable/#allowed
294+
type: array
295+
minLength: 1
296+
uniqueItems: true
297+
items:
298+
description: A valid value of the current environment variable
299+
type: string
300+
minLength: 1
301+
examples:
302+
- production
267303
default:
268-
$ref: '#/definitions/environment-variables-default-property'
304+
title: default
305+
description: |-
306+
A default value of the current environment variable
307+
https://bashly.dannyb.co/configuration/environment-variable/#default
308+
type: string
309+
examples:
310+
- ~/config.ini
269311
patternProperties: *custom-properties
270312
additionalProperties: false
271313
name-property:
@@ -359,61 +401,6 @@ definitions:
359401
- type: string
360402
enum:
361403
- force
362-
environment-variables-name-property:
363-
$comment: '''environment-variables-'' prefix is used as this property is related to https://bashly.dannyb.co/configuration/environment-variable/#environment-variable'
364-
title: name
365-
description: |-
366-
A name of the current environment variable
367-
https://bashly.dannyb.co/configuration/environment-variable/#name
368-
type: string
369-
minLength: 1
370-
examples:
371-
- config_path
372-
environment-variables-help-property:
373-
title: help
374-
description: |-
375-
A description of the current environment variable
376-
https://bashly.dannyb.co/configuration/environment-variable/#help
377-
type: string
378-
minLength: 1
379-
examples:
380-
- Location of the config file
381-
environment-variables-default-property:
382-
title: default
383-
description: |-
384-
A default value of the current environment variable
385-
https://bashly.dannyb.co/configuration/environment-variable/#default
386-
type: string
387-
examples:
388-
- ~/config.ini
389-
environment-variables-private-property:
390-
title: private
391-
description: |-
392-
Whether the current environment variable is hidden from help
393-
https://bashly.dannyb.co/configuration/environment-variable/#private
394-
type: boolean
395-
default: false
396-
environment-variables-required-property:
397-
title: required
398-
description: |-
399-
Whether the current environment variable is required
400-
https://bashly.dannyb.co/configuration/environment-variable/#required
401-
type: boolean
402-
default: true
403-
environment-variables-allowed-property:
404-
title: allowed
405-
description: |-
406-
Valid values of the current environment variable
407-
https://bashly.dannyb.co/configuration/environment-variable/#allowed
408-
type: array
409-
minLength: 1
410-
uniqueItems: true
411-
items:
412-
description: A valid value of the current environment variable
413-
type: string
414-
minLength: 1
415-
examples:
416-
- production
417404
environment-variables-property:
418405
title: environment variables
419406
description: |-

0 commit comments

Comments
 (0)