From 156837795e2464a29a4a0149c11b2546a6aaccda Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Fri, 22 Dec 2023 12:03:03 +0000 Subject: [PATCH] refactor environment_variable in schema --- schemas/bashly.json | 101 ++++++++++++++--------------------- support/schema/bashly.yml | 109 +++++++++++++++++--------------------- 2 files changed, 89 insertions(+), 121 deletions(-) diff --git a/schemas/bashly.json b/schemas/bashly.json index 51192fc9..ff42a2d9 100644 --- a/schemas/bashly.json +++ b/schemas/bashly.json @@ -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": { @@ -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", diff --git a/support/schema/bashly.yml b/support/schema/bashly.yml index f831dd4e..f24e033e 100644 --- a/support/schema/bashly.yml +++ b/support/schema/bashly.yml @@ -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: @@ -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: |-