From 5e2acadee51bdcc8662b175c4468c471d0ee8d45 Mon Sep 17 00:00:00 2001 From: psyirius Date: Wed, 7 Aug 2024 08:10:55 -0700 Subject: [PATCH] added json-schema for config/feature.json --- config/feature.json | 1 + schemas/config/feature.json | 57 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 schemas/config/feature.json diff --git a/config/feature.json b/config/feature.json index bd66859a..59472d91 100644 --- a/config/feature.json +++ b/config/feature.json @@ -1,4 +1,5 @@ { + "$schema": "../schemas/config/feature.json", "WPFFeaturesdotnet": { "Content": "All .Net Framework (2,3,4)", "Description": ".NET and .NET Framework is a developer platform made up of tools, programming languages, and libraries for building many different types of applications.", diff --git a/schemas/config/feature.json b/schemas/config/feature.json new file mode 100644 index 00000000..520aff40 --- /dev/null +++ b/schemas/config/feature.json @@ -0,0 +1,57 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "patternProperties": { + "^[a-zA-Z_][a-zA-Z0-9_]*$": { + "type": "object", + "properties": { + "Content": { + "type": "string" + }, + "Description": { + "type": "string" + }, + "category": { + "type": "string", + "enum": ["Features", "Fixes", "Legacy Windows Panels"] + }, + "panel": { + "type": "string", + "pattern": "^\\d+$" + }, + "Order": { + "type": "string", + "pattern": "^[0-9a-f]+_$" + }, + "feature": { + "type": "array", + "items": { + "type": "string" + } + }, + "InvokeScript": { + "type": "array", + "items": { + "type": "string" + } + }, + "UndoScript": { + "type": "array", + "items": { + "type": "string" + } + }, + "Type": { + "type": "string", + "enum": ["Button"] + }, + "ButtonWidth": { + "type": "string", + "pattern": "^\\d+$" + } + }, + "required": ["Content", "category", "panel"], + "additionalProperties": false + } + } +}