From a5b477155cec7515e3de09c51672797fadcff301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Mon, 16 May 2016 16:59:59 +0200 Subject: [PATCH] Very initial json schema for uhk config. --- config-serializer/config-schema.json | 99 ++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 config-serializer/config-schema.json diff --git a/config-serializer/config-schema.json b/config-serializer/config-schema.json new file mode 100644 index 00000000..df83e460 --- /dev/null +++ b/config-serializer/config-schema.json @@ -0,0 +1,99 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "UHK Configuration", + "description": "UHK Configuration", + "type": "object", + "properties": { + "prologue": { + "description": "Prologue", + "type": "integer" + }, + "keyMaps": { + "description": "Array of keyMaps", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "Id of the keymap", + "type": "integer" + }, + "isDefault": { + "type": "boolean" + }, + "layers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "modules": { + "type": "array", + "items": { + "type": "object", + "properties": { + "keyActions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "keyActionType": { + "type": "string", + "enum": [ + "none", + "keystroke", + "keystrokeModifiers", + "switchLayer", + "switchKeymap", + "playMacro", + "mouse" + ] + } + }, + "oneOf": [ + { + "properties": { + "keyActionType": { + "type": "string", + "pattern": "^keystroke$" + }, + "scancode": { + "type": "integer" + } + } + }, + { + "properties": { + "keyActionType": { + "type": "string", + "pattern": "^switchLayer$" + }, + "layer": { + "type": "string" + }, + "toggle": { + "type": "boolean" + } + } + }, + { + "properties": { + "keyActionType": { + "type": "string", + "pattern": "^none$" + } + } + } + ] + } + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file