From f7e800e615afb8548ac921f9da9780a7b774603d Mon Sep 17 00:00:00 2001 From: EmilyGraceSeville7cf Date: Wed, 20 Dec 2023 02:03:33 +1000 Subject: [PATCH 1/3] feat: support array in default --- schemas/bashly.json | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/schemas/bashly.json b/schemas/bashly.json index 3f648fe4..345a037d 100644 --- a/schemas/bashly.json +++ b/schemas/bashly.json @@ -41,7 +41,18 @@ "default": { "title": "default", "description": "A default value of the current positional argument\nhttps://bashly.dannyb.co/configuration/argument/#default", - "type": "string", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + ], "examples": [ "*.jpg" ] @@ -159,7 +170,18 @@ "default": { "title": "default", "description": "A default value of the current flag\nhttps://bashly.dannyb.co/configuration/flag/#default", - "type": "string", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + ], "examples": [ "*.jpg" ] From fd141cf9bd67ff3e4e7c9cbe1f90e7035724e58c Mon Sep 17 00:00:00 2001 From: EmilyGraceSeville7cf Date: Wed, 20 Dec 2023 03:51:55 +1000 Subject: [PATCH 2/3] feat: test commit to fail json schema tests --- examples/catch-all/src/bashly.yml | 3 ++- schemas/bashly.json | 13 +------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/examples/catch-all/src/bashly.yml b/examples/catch-all/src/bashly.yml index 541b0518..0b7bfef0 100644 --- a/examples/catch-all/src/bashly.yml +++ b/examples/catch-all/src/bashly.yml @@ -8,7 +8,8 @@ catch_all: true args: - name: message required: true - help: Message + default: [""] + x_a: flags: - long: --debug diff --git a/schemas/bashly.json b/schemas/bashly.json index 345a037d..716d9fe1 100644 --- a/schemas/bashly.json +++ b/schemas/bashly.json @@ -41,18 +41,7 @@ "default": { "title": "default", "description": "A default value of the current positional argument\nhttps://bashly.dannyb.co/configuration/argument/#default", - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - ], + "type": "string", "examples": [ "*.jpg" ] From 347dbcc6eaada9fee2a9c67e2177a3767b8088c9 Mon Sep 17 00:00:00 2001 From: EmilyGraceSeville7cf Date: Wed, 20 Dec 2023 04:00:03 +1000 Subject: [PATCH 3/3] Revert "feat: test commit to fail json schema tests" This reverts commit fd141cf9bd67ff3e4e7c9cbe1f90e7035724e58c. --- examples/catch-all/src/bashly.yml | 3 +-- schemas/bashly.json | 13 ++++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/catch-all/src/bashly.yml b/examples/catch-all/src/bashly.yml index 0b7bfef0..541b0518 100644 --- a/examples/catch-all/src/bashly.yml +++ b/examples/catch-all/src/bashly.yml @@ -8,8 +8,7 @@ catch_all: true args: - name: message required: true - default: [""] - x_a: + help: Message flags: - long: --debug diff --git a/schemas/bashly.json b/schemas/bashly.json index 716d9fe1..345a037d 100644 --- a/schemas/bashly.json +++ b/schemas/bashly.json @@ -41,7 +41,18 @@ "default": { "title": "default", "description": "A default value of the current positional argument\nhttps://bashly.dannyb.co/configuration/argument/#default", - "type": "string", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + } + ], "examples": [ "*.jpg" ]