From 89a2d42e13509b929cac40bb9cab22397b9c31d2 Mon Sep 17 00:00:00 2001 From: Attila Greguss Date: Thu, 24 Nov 2022 11:28:03 +0000 Subject: [PATCH] Add json schema for json validation (for manual editing) (#197) --- json-schema/file.json | 24 ++++++++++++++++++++++++ json-schema/program.json | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 json-schema/file.json create mode 100644 json-schema/program.json diff --git a/json-schema/file.json b/json-schema/file.json new file mode 100644 index 0000000..1a3e217 --- /dev/null +++ b/json-schema/file.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "File schema", + "properties": { + "path": { + "type": "string", + "description": "Path to file (or folder).", + "minLength": 1 + }, + "movable": { + "type": "boolean", + "description": "Is file (or folder) movable to a place other than $HOME." + }, + "help": { + "type": "string", + "description": "Help text for user. Supports markdown." + } + }, + "required": [ + "path", + "movable", + "help" + ] +} \ No newline at end of file diff --git a/json-schema/program.json b/json-schema/program.json new file mode 100644 index 0000000..d569273 --- /dev/null +++ b/json-schema/program.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Program", + "description": "Specification of files or folders in the $HOME folder for a program", + "properties": { + "name": { + "type": "string", + "description": "Name of the program", + "minLength": 1 + }, + "files": { + "description": "List of files (or folders) associated with the program", + "type": "array", + "items": { + "$ref": "file.json" + }, + "minItems": 1 + } + }, + "required": [ + "name", + "files" + ] +} \ No newline at end of file -- 2.47.3