From 6d93facc16cd17b2bb7c4adffbd791d27149c582 Mon Sep 17 00:00:00 2001 From: zvecr Date: Tue, 24 May 2022 01:19:16 +0100 Subject: [PATCH] bump some definitions to common --- data/schemas/definitions.jsonschema | 10 ++++++++++ data/schemas/xap.jsonschema | 30 ++++++++++++++--------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema index 1bdfbbeb035..743dec2a0e3 100644 --- a/data/schemas/definitions.jsonschema +++ b/data/schemas/definitions.jsonschema @@ -12,6 +12,12 @@ "minLength": 1, "pattern": "^[0-9a-z_]*$" }, + "define": { + "type": "string", + "minLength": 2, + "maxLength": 50, + "pattern": "^[A-Z_]*$" + }, "hex_number_2d": { "type": "string", "pattern": "^0x[0-9A-F]{2}$" @@ -24,6 +30,10 @@ "type": "string", "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$" }, + "text_unsigned_int": { + "type": "string", + "pattern": "^[0-8]+$" + }, "text_identifier": { "type": "string", "minLength": 1, diff --git a/data/schemas/xap.jsonschema b/data/schemas/xap.jsonschema index 537e8aef6e3..db0e7c4e87f 100644 --- a/data/schemas/xap.jsonschema +++ b/data/schemas/xap.jsonschema @@ -3,14 +3,6 @@ "$id": "qmk.xap.v1", "title": "XAP Spec", "definitions": { - "int_key": { - "type": "string", - "pattern": "^[0-8]$" - }, - "constant": { - "type": "string", - "pattern": "^[A-Z_]*$" - }, "data_type": { "oneOf": [ { @@ -47,6 +39,10 @@ "items": { "type": "object", "additionalProperties": false, + "required": [ + "name", + "type" + ], "properties": { "name": { "type": "string" @@ -64,6 +60,10 @@ }, "additionalProperties": { "type": "object", + "required": [ + "type", + "define" + ], "additionalProperties": false, "properties": { "type": { @@ -76,7 +76,7 @@ "type": "string" }, "define": { - "$ref": "#/definitions/constant" + "$ref": "qmk.definitions.v1#/define" }, "permissions": { "$ref": "#/definitions/permission" @@ -134,7 +134,7 @@ "$ref": "qmk.definitions.v1#/bcd_version" }, "define": { - "$ref": "#/definitions/constant" + "$ref": "qmk.definitions.v1#/define" }, "uses": { "type": "object", @@ -197,12 +197,12 @@ "additionalProperties": false, "properties": { "define_prefix": { - "$ref": "#/definitions/constant" + "$ref": "qmk.definitions.v1#/define" }, "bits": { "type": "object", "propertyNames": { - "$ref": "#/definitions/int_key" + "$ref": "qmk.definitions.v1#/text_unsigned_int" }, "additionalProperties": { "type": "object", @@ -212,7 +212,7 @@ "type": "string" }, "define": { - "$ref": "#/definitions/constant" + "$ref": "qmk.definitions.v1#/define" }, "description": { "type": "string" @@ -227,7 +227,7 @@ "additionalProperties": false, "properties": { "define_prefix": { - "$ref": "#/definitions/constant" + "$ref": "qmk.definitions.v1#/define" }, "messages": { "type": "object", @@ -242,7 +242,7 @@ "type": "string" }, "define": { - "$ref": "#/definitions/constant" + "$ref": "qmk.definitions.v1#/define" }, "description": { "type": "string"