From fbfd5312b995a32af690c183cad0dc988f695e89 Mon Sep 17 00:00:00 2001 From: Erovia Date: Mon, 28 Feb 2022 20:02:39 +0000 Subject: CLI: Validate JSON keymap input (#16261) * Fix schema validator It should use the passed schema. * Add required attributes to keymap schema * Rework subcommands to validate the JSON keymaps The 'compile', 'flash' and 'json2c' subcommands were reworked to add JSON keymap validation so error is reported for non-JSON and non-compliant-JSON inputs. * Fix required fields in keymap schema * Add tests * Fix compiling keymaps directly from keymap directory * Schema should not require version for now. --- data/schemas/keymap.jsonschema | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'data/schemas') diff --git a/data/schemas/keymap.jsonschema b/data/schemas/keymap.jsonschema index faa250a942..3803301a66 100644 --- a/data/schemas/keymap.jsonschema +++ b/data/schemas/keymap.jsonschema @@ -53,5 +53,10 @@ "type": "string", "description": "asdf" } - } + }, + "required": [ + "keyboard", + "layout", + "layers" + ] } -- cgit v1.2.3