Skip to content

Commit

Permalink
refactor environment_variable in schema
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBen committed Dec 22, 2023
1 parent 2bcc8a3 commit 1568377
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 121 deletions.
101 changes: 41 additions & 60 deletions schemas/bashly.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,22 +290,57 @@
],
"properties": {
"name": {
"$ref": "#/definitions/environment-variables-name-property"
"title": "name",
"description": "A name of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#name",
"type": "string",
"minLength": 1,
"examples": [
"config_path"
]
},
"help": {
"$ref": "#/definitions/environment-variables-help-property"
"title": "help",
"description": "A description of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#help",
"type": "string",
"minLength": 1,
"examples": [
"Location of the config file"
]
},
"private": {
"$ref": "#/definitions/environment-variables-private-property"
"title": "private",
"description": "Whether the current environment variable is hidden from help\nhttps://bashly.dannyb.co/configuration/environment-variable/#private",
"type": "boolean",
"default": false
},
"required": {
"$ref": "#/definitions/environment-variables-required-property"
"title": "required",
"description": "Whether the current environment variable is required\nhttps://bashly.dannyb.co/configuration/environment-variable/#required",
"type": "boolean",
"default": true
},
"allowed": {
"$ref": "#/definitions/environment-variables-allowed-property"
"title": "allowed",
"description": "Valid values of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#allowed",
"type": "array",
"minLength": 1,
"uniqueItems": true,
"items": {
"description": "A valid value of the current environment variable",
"type": "string",
"minLength": 1,
"examples": [
"production"
]
}
},
"default": {
"$ref": "#/definitions/environment-variables-default-property"
"title": "default",
"description": "A default value of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#default",
"type": "string",
"examples": [
"~/config.ini"
]
}
},
"patternProperties": {
Expand Down Expand Up @@ -420,60 +455,6 @@
}
]
},
"environment-variables-name-property": {
"$comment": "'environment-variables-' prefix is used as this property is related to https://bashly.dannyb.co/configuration/environment-variable/#environment-variable",
"title": "name",
"description": "A name of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#name",
"type": "string",
"minLength": 1,
"examples": [
"config_path"
]
},
"environment-variables-help-property": {
"title": "help",
"description": "A description of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#help",
"type": "string",
"minLength": 1,
"examples": [
"Location of the config file"
]
},
"environment-variables-default-property": {
"title": "default",
"description": "A default value of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#default",
"type": "string",
"examples": [
"~/config.ini"
]
},
"environment-variables-private-property": {
"title": "private",
"description": "Whether the current environment variable is hidden from help\nhttps://bashly.dannyb.co/configuration/environment-variable/#private",
"type": "boolean",
"default": false
},
"environment-variables-required-property": {
"title": "required",
"description": "Whether the current environment variable is required\nhttps://bashly.dannyb.co/configuration/environment-variable/#required",
"type": "boolean",
"default": true
},
"environment-variables-allowed-property": {
"title": "allowed",
"description": "Valid values of the current environment variable\nhttps://bashly.dannyb.co/configuration/environment-variable/#allowed",
"type": "array",
"minLength": 1,
"uniqueItems": true,
"items": {
"description": "A valid value of the current environment variable",
"type": "string",
"minLength": 1,
"examples": [
"production"
]
}
},
"environment-variables-property": {
"title": "environment variables",
"description": "Environment variables of the current application\nhttps://bashly.dannyb.co/configuration/environment-variable/#environment-variable",
Expand Down
109 changes: 48 additions & 61 deletions support/schema/bashly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,59 @@ definitions:
- name
properties:
name:
$ref: '#/definitions/environment-variables-name-property'
title: name
description: |-
A name of the current environment variable
https://bashly.dannyb.co/configuration/environment-variable/#name
type: string
minLength: 1
examples:
- config_path
help:
$ref: '#/definitions/environment-variables-help-property'
title: help
description: |-
A description of the current environment variable
https://bashly.dannyb.co/configuration/environment-variable/#help
type: string
minLength: 1
examples:
- Location of the config file
private:
$ref: '#/definitions/environment-variables-private-property'
title: private
description: |-
Whether the current environment variable is hidden from help
https://bashly.dannyb.co/configuration/environment-variable/#private
type: boolean
default: false
required:
$ref: '#/definitions/environment-variables-required-property'
title: required
description: |-
Whether the current environment variable is required
https://bashly.dannyb.co/configuration/environment-variable/#required
type: boolean
default: true
allowed:
$ref: '#/definitions/environment-variables-allowed-property'
title: allowed
description: |-
Valid values of the current environment variable
https://bashly.dannyb.co/configuration/environment-variable/#allowed
type: array
minLength: 1
uniqueItems: true
items:
description: A valid value of the current environment variable
type: string
minLength: 1
examples:
- production
default:
$ref: '#/definitions/environment-variables-default-property'
title: default
description: |-
A default value of the current environment variable
https://bashly.dannyb.co/configuration/environment-variable/#default
type: string
examples:
- ~/config.ini
patternProperties: *custom-properties
additionalProperties: false
name-property:
Expand Down Expand Up @@ -359,61 +401,6 @@ definitions:
- type: string
enum:
- force
environment-variables-name-property:
$comment: '''environment-variables-'' prefix is used as this property is related to https://bashly.dannyb.co/configuration/environment-variable/#environment-variable'
title: name
description: |-
A name of the current environment variable
https://bashly.dannyb.co/configuration/environment-variable/#name
type: string
minLength: 1
examples:
- config_path
environment-variables-help-property:
title: help
description: |-
A description of the current environment variable
https://bashly.dannyb.co/configuration/environment-variable/#help
type: string
minLength: 1
examples:
- Location of the config file
environment-variables-default-property:
title: default
description: |-
A default value of the current environment variable
https://bashly.dannyb.co/configuration/environment-variable/#default
type: string
examples:
- ~/config.ini
environment-variables-private-property:
title: private
description: |-
Whether the current environment variable is hidden from help
https://bashly.dannyb.co/configuration/environment-variable/#private
type: boolean
default: false
environment-variables-required-property:
title: required
description: |-
Whether the current environment variable is required
https://bashly.dannyb.co/configuration/environment-variable/#required
type: boolean
default: true
environment-variables-allowed-property:
title: allowed
description: |-
Valid values of the current environment variable
https://bashly.dannyb.co/configuration/environment-variable/#allowed
type: array
minLength: 1
uniqueItems: true
items:
description: A valid value of the current environment variable
type: string
minLength: 1
examples:
- production
environment-variables-property:
title: environment variables
description: |-
Expand Down

0 comments on commit 1568377

Please sign in to comment.