From d508dc69dc4d11d42c0cd7d60ba15dda708f6264 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sun, 18 Jun 2023 02:07:34 +0800 Subject: [PATCH] JsonConfig: update JSON schema --- src/data/json_schema.jsonc | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/data/json_schema.jsonc b/src/data/json_schema.jsonc index 0279f38a6..61de25f6d 100644 --- a/src/data/json_schema.jsonc +++ b/src/data/json_schema.jsonc @@ -1,6 +1,13 @@ { "$schema": "http://json-schema.org/schema", + "$defs": { + "colors": { + "type": "string", + "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + } + }, "type": "object", + "title": "JSON config file for fastfetch", "properties": { "logo": { "title": "Fastfetch logo configurations", @@ -33,49 +40,40 @@ "title": "Overwrite a color in the logo", "properties": { "1": { - "type": "string", "title": "Color 1", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "2": { - "type": "string", "title": "Color 2", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "3": { - "type": "string", "title": "Color 3", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "4": { - "type": "string", "title": "Color 4", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "5": { - "type": "string", "title": "Color 5", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "6": { - "type": "string", "title": "Color 6", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "7": { - "type": "string", "title": "Color 7", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "8": { - "type": "string", "title": "Color 8", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "9": { - "type": "string", "title": "Color 9", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" } } }, @@ -235,21 +233,19 @@ "title": "Set the color of the keys and title", "anyOf": [ { - "type": "string", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "title": "Set the both color of the keys and title", + "$ref": "#/$defs/colors" }, { "type": "object", "properties": { "keys": { - "type": "string", "title": "Set the color of the keys", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" }, "title": { - "type": "string", "title": "Set the color of the title", - "enum": ["reset_", "bright_", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] + "$ref": "#/$defs/colors" } } } @@ -427,10 +423,10 @@ { "properties": { "type": { - "enum": ["break", "Colors"], - "additionalProperties": false + "enum": ["Break", "Colors"] } - } + }, + "additionalProperties": false }, { "properties": { @@ -457,9 +453,11 @@ ] }, "key": { + "title": "Key of the module", "type": "string" }, "format": { + "title": "Format of the module", "type": "string" } }, @@ -633,7 +631,8 @@ "format": { "type": "string" } - } + }, + "additionalProperties": false }, { "properties": { @@ -723,7 +722,8 @@ "format": { "type": "string" } - } + }, + "additionalProperties": false } ] }