summaryrefslogtreecommitdiff
path: root/data/schemas/definitions.jsonschema
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-08-29 08:20:25 +1000
committerNick Brassel <nick@tzarc.org>2021-08-29 08:20:25 +1000
commitf061ca497464fe85284906fb163a33eaee7a91ef (patch)
tree33ef1bfb529aed382e8526c607c4e18717f92571 /data/schemas/definitions.jsonschema
parentff65185dec6f97be1eb49f17cea526a0d0bbf3d6 (diff)
parent4bad375d7c09d949a9dcdd4feba147c9c7a67ec6 (diff)
Breaking changes develop merge to master, 2021Q3 edition. (#14196)
Diffstat (limited to 'data/schemas/definitions.jsonschema')
-rw-r--r--data/schemas/definitions.jsonschema107
1 files changed, 107 insertions, 0 deletions
diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema
new file mode 100644
index 0000000000..822f237073
--- /dev/null
+++ b/data/schemas/definitions.jsonschema
@@ -0,0 +1,107 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "$id": "qmk.definitions.v1",
+ "title": "Common definitions used across QMK's jsonschemas.",
+ "type": "object",
+ "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": "#/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"
+ }
+ ]
+ },
+ "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": {
+ "type": "string"
+ }
+ },
+ "string_object": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "unsigned_decimal": {
+ "type": "number",
+ "min": 0
+ },
+ "unsigned_int": {
+ "type": "number",
+ "min": 0,
+ "multipleOf": 1
+ }
+ "unsigned_int_8": {
+ "type": "number",
+ "min": 0,
+ "max": 255,
+ "multipleOf": 1
+ }
+}