From 7a331d31c42cefd84c00dfe33da8ef24a68f9f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Sat, 16 Jul 2016 17:45:39 +0200 Subject: [PATCH] Improve JSON schema --- config-serializer/config-schema.json | 72 ++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/config-serializer/config-schema.json b/config-serializer/config-schema.json index 0ddd1988..2ae2bf04 100644 --- a/config-serializer/config-schema.json +++ b/config-serializer/config-schema.json @@ -48,12 +48,46 @@ ] } }, + "required": [ + "keyActionType" + ], "oneOf": [ { "properties": { "keyActionType": { "type": "string", - "pattern": "^keystroke$" + "enum": [ + "mouse" + ] + }, + "mouseAction": { + "type": "string", + "enum": [ + "leftClick", + "middleClick", + "rightClick", + "moveUp", + "moveDown", + "moveLeft", + "moveRight", + "scrollUp", + "scrollDown", + "scrollLeft", + "scrollRight", + "accelerate", + "decelerate" + ] + } + } + }, + { + "type": "object", + "properties": { + "keyActionType": { + "type": "string", + "enum": [ + "keystroke" + ] }, "scancode": { "type": "integer" @@ -61,10 +95,13 @@ } }, { + "type": "object", "properties": { "keyActionType": { "type": "string", - "pattern": "^switchLayer$" + "enum": [ + "switchLayer" + ] }, "layer": { "type": "string" @@ -75,10 +112,39 @@ } }, { + "type": "object", "properties": { "keyActionType": { "type": "string", - "pattern": "^none$" + "enum": [ + "switchKeymap" + ] + }, + "keymapId": { + "type": "integer" + } + } + }, + { + "properties": { + "keyActionType": { + "type": "string", + "enum": [ + "playMacro" + ] + }, + "macroId": { + "type": "integer" + } + } + }, + { + "properties": { + "keyActionType": { + "type": "string", + "enum": [ + "none" + ] } } }