Browse Source

bump some definitions to common

zvecr 4 years ago
parent
commit
6d93facc16
2 changed files with 25 additions and 15 deletions
  1. 10 0
      data/schemas/definitions.jsonschema
  2. 15 15
      data/schemas/xap.jsonschema

+ 10 - 0
data/schemas/definitions.jsonschema

@@ -12,6 +12,12 @@
         "minLength": 1,
         "minLength": 1,
         "pattern": "^[0-9a-z_]*$"
         "pattern": "^[0-9a-z_]*$"
     },
     },
+    "define": {
+        "type": "string",
+        "minLength": 2,
+        "maxLength": 50,
+        "pattern": "^[A-Z_]*$"
+    },
     "hex_number_2d": {
     "hex_number_2d": {
         "type": "string",
         "type": "string",
         "pattern": "^0x[0-9A-F]{2}$"
         "pattern": "^0x[0-9A-F]{2}$"
@@ -24,6 +30,10 @@
         "type": "string",
         "type": "string",
         "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$"
         "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$"
     },
     },
+    "text_unsigned_int": {
+        "type": "string",
+        "pattern": "^[0-8]+$"
+    },
     "text_identifier": {
     "text_identifier": {
         "type": "string",
         "type": "string",
         "minLength": 1,
         "minLength": 1,

+ 15 - 15
data/schemas/xap.jsonschema

@@ -3,14 +3,6 @@
     "$id": "qmk.xap.v1",
     "$id": "qmk.xap.v1",
     "title": "XAP Spec",
     "title": "XAP Spec",
     "definitions": {
     "definitions": {
-        "int_key": {
-            "type": "string",
-            "pattern": "^[0-8]$"
-        },
-        "constant": {
-            "type": "string",
-            "pattern": "^[A-Z_]*$"
-        },
         "data_type": {
         "data_type": {
             "oneOf": [
             "oneOf": [
                 {
                 {
@@ -47,6 +39,10 @@
             "items": {
             "items": {
                 "type": "object",
                 "type": "object",
                 "additionalProperties": false,
                 "additionalProperties": false,
+                "required": [
+                    "name",
+                    "type"
+                ],
                 "properties": {
                 "properties": {
                     "name": {
                     "name": {
                         "type": "string"
                         "type": "string"
@@ -64,6 +60,10 @@
             },
             },
             "additionalProperties": {
             "additionalProperties": {
                 "type": "object",
                 "type": "object",
+                "required": [
+                    "type",
+                    "define"
+                ],
                 "additionalProperties": false,
                 "additionalProperties": false,
                 "properties": {
                 "properties": {
                     "type": {
                     "type": {
@@ -76,7 +76,7 @@
                         "type": "string"
                         "type": "string"
                     },
                     },
                     "define": {
                     "define": {
-                        "$ref": "#/definitions/constant"
+                        "$ref": "qmk.definitions.v1#/define"
                     },
                     },
                     "permissions": {
                     "permissions": {
                         "$ref": "#/definitions/permission"
                         "$ref": "#/definitions/permission"
@@ -134,7 +134,7 @@
             "$ref": "qmk.definitions.v1#/bcd_version"
             "$ref": "qmk.definitions.v1#/bcd_version"
         },
         },
         "define": {
         "define": {
-            "$ref": "#/definitions/constant"
+            "$ref": "qmk.definitions.v1#/define"
         },
         },
         "uses": {
         "uses": {
             "type": "object",
             "type": "object",
@@ -197,12 +197,12 @@
             "additionalProperties": false,
             "additionalProperties": false,
             "properties": {
             "properties": {
                 "define_prefix": {
                 "define_prefix": {
-                    "$ref": "#/definitions/constant"
+                    "$ref": "qmk.definitions.v1#/define"
                 },
                 },
                 "bits": {
                 "bits": {
                     "type": "object",
                     "type": "object",
                     "propertyNames": {
                     "propertyNames": {
-                        "$ref": "#/definitions/int_key"
+                        "$ref": "qmk.definitions.v1#/text_unsigned_int"
                     },
                     },
                     "additionalProperties": {
                     "additionalProperties": {
                         "type": "object",
                         "type": "object",
@@ -212,7 +212,7 @@
                                 "type": "string"
                                 "type": "string"
                             },
                             },
                             "define": {
                             "define": {
-                                "$ref": "#/definitions/constant"
+                                "$ref": "qmk.definitions.v1#/define"
                             },
                             },
                             "description": {
                             "description": {
                                 "type": "string"
                                 "type": "string"
@@ -227,7 +227,7 @@
             "additionalProperties": false,
             "additionalProperties": false,
             "properties": {
             "properties": {
                 "define_prefix": {
                 "define_prefix": {
-                    "$ref": "#/definitions/constant"
+                    "$ref": "qmk.definitions.v1#/define"
                 },
                 },
                 "messages": {
                 "messages": {
                     "type": "object",
                     "type": "object",
@@ -242,7 +242,7 @@
                                 "type": "string"
                                 "type": "string"
                             },
                             },
                             "define": {
                             "define": {
-                                "$ref": "#/definitions/constant"
+                                "$ref": "qmk.definitions.v1#/define"
                             },
                             },
                             "description": {
                             "description": {
                                 "type": "string"
                                 "type": "string"