From 79f0fec58a81f774a3324880a0f86b45cd8942e1 Mon Sep 17 00:00:00 2001 From: "m.kindritskiy" Date: Sat, 26 Oct 2024 15:30:43 +0300 Subject: [PATCH 1/2] Make command one of string or object --- docs/static/schema.json | 145 +++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 67 deletions(-) diff --git a/docs/static/schema.json b/docs/static/schema.json index 6cea48a..9be5b90 100644 --- a/docs/static/schema.json +++ b/docs/static/schema.json @@ -35,87 +35,98 @@ "description": "Set of commands to execute.", "patternProperties": { "^[a-zA-Z][a-zA-Z0-9_:-]*$": { - "type": "object", - "properties": { - "description": { + "oneOf": [ + { "type": "string", - "description": "A description of the command." + "description": "Command as a string." }, - "options": { + { + "$ref": "#/definitions/command_object" + } + ] + } + } + } + }, + "required": [ + "commands" + ], + "definitions": { + "command_object": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "A description of the command." + }, + "options": { + "type": "string", + "description": "Options for the command in docopt format." + }, + "cmd": { + "oneOf": [ + { "type": "string", - "description": "Options for the command in docopt format." - }, - "cmd": { - "oneOf": [ - { - "type": "string", - "description": "Command as a string." - }, - { - "type": "array", - "description": "Command as a list of strings.", - "items": { - "type": "string" - } - }, - { - "type": "object", - "description": "Command as an object with key as named command and value as a script", - "patternProperties": { - "^[a-zA-Z_][a-zA-Z0-9_]*$": { - "oneOf": [ - { - "type": "string", - "description": "Command as a string." - }, - { - "type": "array", - "description": "Command as a list of strings.", - "items": { - "type": "string" - } - } - ] - } - } - } - ] + "description": "Command as a string." }, - "depends": { + { "type": "array", + "description": "Command as a list of strings.", "items": { "type": "string" } }, - "persist_checksum": { - "type": "boolean" - }, - "checksum": { - "type": "array", - "items": { - "type": "string" + { + "type": "object", + "description": "Command as an object with key as named command and value as a script", + "patternProperties": { + "^[a-zA-Z_][a-zA-Z0-9_]*$": { + "oneOf": [ + { + "type": "string", + "description": "Command as a string." + }, + { + "type": "array", + "description": "Command as a list of strings.", + "items": { + "type": "string" + } + } + ] + } } - }, - "env": { - "$ref": "#/definitions/env" - }, - "after": { - "type": "string", - "description": "A shell sctipt to run after the command." - }, - "work_dir": { - "type": "string", - "description": "A directory to run the command in." } + ] + }, + "depends": { + "type": "array", + "items": { + "type": "string" } + }, + "persist_checksum": { + "type": "boolean" + }, + "checksum": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "$ref": "#/definitions/env" + }, + "after": { + "type": "string", + "description": "A shell sctipt to run after the command." + }, + "work_dir": { + "type": "string", + "description": "A directory to run the command in." } } - } - }, - "required": [ - "commands" - ], - "definitions": { + }, "env": { "type": "object", "description": "Environment variables to set.", From 8dc2c775d8251f54762d51dc72c3011f8228ecbd Mon Sep 17 00:00:00 2001 From: "m.kindritskiy" Date: Sat, 26 Oct 2024 15:56:47 +0300 Subject: [PATCH 2/2] make mixins one of string or remote object --- docs/static/schema.json | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/static/schema.json b/docs/static/schema.json index 9be5b90..77cc0c7 100644 --- a/docs/static/schema.json +++ b/docs/static/schema.json @@ -16,7 +16,27 @@ "type": "array", "description": "List of mixin files to include.", "items": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to the mixin file." + }, + "version": { + "type": "number", + "description": "Version of the mixin file." + } + }, + "required": [ + "url" + ] + } + ] } }, "env": {