From c119e44febffdf7d0fd3384a6b06c1b2fa1022b5 Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Thu, 21 Dec 2023 05:29:09 +0000 Subject: [PATCH] improve readability of yaml schema --- schemas/bashly.json | 11 ----------- schemas/src/bashly.yml | 24 +++++++++++------------- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/schemas/bashly.json b/schemas/bashly.json index 51648b0f..73d3d86e 100644 --- a/schemas/bashly.json +++ b/schemas/bashly.json @@ -1,17 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema", "definitions": { - "custom-properties": { - "patternProperties": { - "^x_.": { - "title": "custom property", - "description": "A custom property of any type", - "examples": [ - "Anything" - ] - } - } - }, "argument": { "title": "argument", "description": "A positional argument of the current script or sub-command\nhttps://bashly.dannyb.co/configuration/argument/", diff --git a/schemas/src/bashly.yml b/schemas/src/bashly.yml index 8368da96..3bd64e03 100644 --- a/schemas/src/bashly.yml +++ b/schemas/src/bashly.yml @@ -1,12 +1,5 @@ $schema: http://json-schema.org/draft-07/schema definitions: - custom-properties: &custom-properties - patternProperties: - ^x_.: - title: custom property - description: A custom property of any type - examples: - - Anything argument: title: argument description: |- @@ -98,7 +91,12 @@ definitions: properties: repeatable: const: true - <<: *custom-properties + patternProperties: &custom-properties + ^x_.: + title: custom property + description: A custom property of any type + examples: + - Anything additionalProperties: false flag: title: flag @@ -245,7 +243,7 @@ definitions: properties: repeatable: const: true - <<: *custom-properties + patternProperties: *custom-properties additionalProperties: false name-property: title: name @@ -421,7 +419,7 @@ definitions: $ref: '#/definitions/environment-variables-private-property' required: $ref: '#/definitions/environment-variables-required-property' - <<: *custom-properties + patternProperties: *custom-properties additionalProperties: false else: properties: @@ -433,7 +431,7 @@ definitions: $ref: '#/definitions/environment-variables-private-property' required: $ref: '#/definitions/environment-variables-required-property' - <<: *custom-properties + patternProperties: *custom-properties additionalProperties: false examples-property: title: examples @@ -732,7 +730,7 @@ definitions: $ref: '#/definitions/sub-command-private-property' import: $ref: '#/definitions/sub-command-import-property' - <<: *custom-properties + patternProperties: *custom-properties additionalProperties: false title: cli description: |- @@ -772,5 +770,5 @@ properties: $ref: '#/definitions/filters-property' function: $ref: '#/definitions/function-property' -<<: *custom-properties +patternProperties: *custom-properties additionalProperties: false