From 846da06380d7707e3827479653773bc6ec9be55e Mon Sep 17 00:00:00 2001 From: Zach White Date: Mon, 21 Jun 2021 09:58:11 -0700 Subject: [PATCH] cleanup --- data/schemas/definitions.jsonschema | 17 ++++- data/schemas/keyboard.jsonschema | 104 ++-------------------------- 2 files changed, 22 insertions(+), 99 deletions(-) diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema index e21915a948..822f237073 100644 --- a/data/schemas/definitions.jsonschema +++ b/data/schemas/definitions.jsonschema @@ -64,6 +64,19 @@ } ] }, + "signed_decimal": { + "type": "number" + }, + "signed_int": { + "type": "number", + "multipleOf": 1 + } + "signed_int_8": { + "type": "number", + "min": -127, + "max": 127, + "multipleOf": 1 + } "string_array": { "type": "array", "items": { @@ -80,12 +93,12 @@ "type": "number", "min": 0 }, - "unsigned_integer": { + "unsigned_int": { "type": "number", "min": 0, "multipleOf": 1 } - "unsigned_integer_8": { + "unsigned_int_8": { "type": "number", "min": 0, "max": 255, diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index c74336a2ea..d6d33ce4ec 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -3,96 +3,6 @@ "$id": "qmk.keyboard.v1", "title": "Keyboard Information", "type": "object", - "definitions": { - "boolean_array": { - "type": "object", - "additionalProperties": {"type": "boolean"} - }, - "filename": { - "type": "string", - "minLength": 1, - "pattern": "^[0-9a-z_]*$" - }, - "hex_number_2d": { - "type": "string", - "pattern": "^0x[0-9A-F]{2}$" - }, - "hex_number_4d": { - "type": "string", - "pattern": "^0x[0-9A-F]{4}$" - }, - "text_identifier": { - "type": "string", - "minLength": 1, - "maxLength": 250 - }, - "layout_macro": { - "oneOf": [ - { - "type": "string", - "enum": ["LAYOUT", "LAYOUT_planck_1x2uC"] - }, - { - "type": "string", - "pattern": "^LAYOUT_[0-9a-z_]*$" - } - ] - }, - "key_unit": { - "type": "number", - "min": 0.25 - }, - "mcu_pin_array": { - "type": "array", - "items": {"$ref": "qmk.definitions.v1#/mcu_pin"} - }, - "mcu_pin": { - "oneOf": [ - { - "type": "string", - "pattern": "^[A-K]\\d{1,2}$" - }, - { - "type": "string", - "pattern": "^LINE_PIN\\d{1,2}$" - }, - { - "type": "number", - "multipleOf": 1 - }, - { - "type": "null" - } - ] - }, - "string_array": { - "type": "array", - "items": { - "type": "string" - } - }, - "string_object": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "unsigned_decimal": { - "type": "number", - "min": 0 - }, - "unsigned_integer": { - "type": "number", - "min": 0, - "multipleOf": 1 - } - "unsigned_integer_8": { - "type": "number", - "min": 0, - "max": 255, - "multipleOf": 1 - } - } "properties": { "keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"}, "maintainer": {"$ref": "qmk.definitions.v1#/text_identifier"}, @@ -118,7 +28,7 @@ "type": "string", "enum": ["COL2ROW", "ROW2COL"] }, - "debounce": {"$ref": "qmk.definitions.v1#/unsigned_integer"}, + "debounce": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "height": {"$ref": "qmk.definitions.v1#/key_unit"}, "width": {"$ref": "qmk.definitions.v1#/key_unit"}, "community_layouts": { @@ -204,19 +114,19 @@ "type": "boolean" } }, - "brightness_steps": {"$ref": "qmk.definitions.v1#/unsigned_integer"}, - "hue_steps": {"$ref": "qmk.definitions.v1#/unsigned_integer"}, - "led_count": {"$ref": "qmk.definitions.v1#/unsigned_integer"}, - "max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_integer_8"}, + "brightness_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "hue_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "led_count": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, - "saturation_steps": {"$ref": "qmk.definitions.v1#/unsigned_integer"}, + "saturation_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "sleep": {"type": "boolean"}, "split": {"type": "boolean"}, "split_count": { "type": "array", "minLength": 2, "maxLength": 2, - "items": {"$ref": "qmk.definitions.v1#/unsigned_integer"} + "items": {"$ref": "qmk.definitions.v1#/unsigned_int"} } } },