diff options
| -rw-r--r-- | data/schemas/definitions.jsonschema | 162 |
1 files changed, 77 insertions, 85 deletions
diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema index ea29343d0a..a1fdd2dcc6 100644 --- a/data/schemas/definitions.jsonschema +++ b/data/schemas/definitions.jsonschema | |||
| @@ -3,10 +3,25 @@ | |||
| 3 | "$id": "qmk.definitions.v1", | 3 | "$id": "qmk.definitions.v1", |
| 4 | "title": "Common definitions used across QMK's jsonschemas.", | 4 | "title": "Common definitions used across QMK's jsonschemas.", |
| 5 | "type": "object", | 5 | "type": "object", |
| 6 | "bcd_version": { | ||
| 7 | "type": "string", | ||
| 8 | "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$" | ||
| 9 | }, | ||
| 10 | "bit": { | ||
| 11 | "type": "integer", | ||
| 12 | "minimum": 0, | ||
| 13 | "maximum": 1 | ||
| 14 | }, | ||
| 6 | "boolean_array": { | 15 | "boolean_array": { |
| 7 | "type": "object", | 16 | "type": "object", |
| 8 | "additionalProperties": {"type": "boolean"} | 17 | "additionalProperties": {"type": "boolean"} |
| 9 | }, | 18 | }, |
| 19 | "build_target": { | ||
| 20 | "oneOf": [ | ||
| 21 | {"$ref": "#/keyboard_keymap_tuple"}, | ||
| 22 | {"$ref": "#/json_file_path"} | ||
| 23 | ] | ||
| 24 | }, | ||
| 10 | "filename": { | 25 | "filename": { |
| 11 | "type": "string", | 26 | "type": "string", |
| 12 | "minLength": 1, | 27 | "minLength": 1, |
| @@ -20,18 +35,56 @@ | |||
| 20 | "type": "string", | 35 | "type": "string", |
| 21 | "pattern": "^0x[0-9A-F]{4}$" | 36 | "pattern": "^0x[0-9A-F]{4}$" |
| 22 | }, | 37 | }, |
| 23 | "bcd_version": { | 38 | "json_file_path": { |
| 24 | "type": "string", | 39 | "type": "string", |
| 25 | "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$" | 40 | "pattern": "^[0-9a-z_/\\-]+\\.json$" |
| 26 | }, | 41 | }, |
| 27 | "text_identifier": { | 42 | "key_unit": { |
| 43 | "type": "number" | ||
| 44 | }, | ||
| 45 | "keyboard": { | ||
| 28 | "type": "string", | 46 | "type": "string", |
| 29 | "minLength": 1, | 47 | "pattern": "^[0-9a-z][0-9a-z_/]*$" |
| 30 | "maxLength": 250 | ||
| 31 | }, | 48 | }, |
| 32 | "snake_case": { | 49 | "keyboard_keymap_tuple": { |
| 50 | "type": "array", | ||
| 51 | "prefixItems": [ | ||
| 52 | {"$ref": "#/keyboard"}, | ||
| 53 | {"$ref": "#/filename"} | ||
| 54 | ], | ||
| 55 | "unevaluatedItems": false | ||
| 56 | }, | ||
| 57 | "keycode": { | ||
| 33 | "type": "string", | 58 | "type": "string", |
| 34 | "pattern": "^[a-z][a-z0-9_]*$" | 59 | "minLength": 2, |
| 60 | "maxLength": 50, | ||
| 61 | "pattern": "^[A-Z][A-Zs_0-9]*$" | ||
| 62 | }, | ||
| 63 | "keycode_decl": { | ||
| 64 | "type": "object", | ||
| 65 | "required": [ | ||
| 66 | "key" | ||
| 67 | ], | ||
| 68 | "properties": { | ||
| 69 | "key": {"$ref": "#/keycode"}, | ||
| 70 | "label": {"$ref": "#/text_identifier"}, | ||
| 71 | "aliases": { | ||
| 72 | "type": "array", | ||
| 73 | "minItems": 1, | ||
| 74 | "items": {"$ref": "#/keycode_short"} | ||
| 75 | } | ||
| 76 | } | ||
| 77 | }, | ||
| 78 | "keycode_decl_array": { | ||
| 79 | "type": "array", | ||
| 80 | "minItems": 1, | ||
| 81 | "items": {"$ref": "#/keycode_decl"} | ||
| 82 | }, | ||
| 83 | "keycode_short": { | ||
| 84 | "type": "string", | ||
| 85 | "minLength": 2, | ||
| 86 | "maxLength": 7, | ||
| 87 | "pattern": "^[A-Z][A-Zs_0-9]*$" | ||
| 35 | }, | 88 | }, |
| 36 | "layout_macro": { | 89 | "layout_macro": { |
| 37 | "oneOf": [ | 90 | "oneOf": [ |
| @@ -68,49 +121,6 @@ | |||
| 68 | } | 121 | } |
| 69 | ] | 122 | ] |
| 70 | }, | 123 | }, |
| 71 | "key_unit": { | ||
| 72 | "type": "number" | ||
| 73 | }, | ||
| 74 | "keyboard": { | ||
| 75 | "type": "string", | ||
| 76 | "pattern": "^[0-9a-z][0-9a-z_/]*$" | ||
| 77 | }, | ||
| 78 | "keycode": { | ||
| 79 | "type": "string", | ||
| 80 | "minLength": 2, | ||
| 81 | "maxLength": 50, | ||
| 82 | "pattern": "^[A-Z][A-Zs_0-9]*$" | ||
| 83 | }, | ||
| 84 | "keycode_short": { | ||
| 85 | "type": "string", | ||
| 86 | "minLength": 2, | ||
| 87 | "maxLength": 7, | ||
| 88 | "pattern": "^[A-Z][A-Zs_0-9]*$" | ||
| 89 | }, | ||
| 90 | "keycode_decl": { | ||
| 91 | "type": "object", | ||
| 92 | "required": [ | ||
| 93 | "key" | ||
| 94 | ], | ||
| 95 | "properties": { | ||
| 96 | "key": {"$ref": "#/keycode"}, | ||
| 97 | "label": {"$ref": "#/text_identifier"}, | ||
| 98 | "aliases": { | ||
| 99 | "type": "array", | ||
| 100 | "minItems": 1, | ||
| 101 | "items": {"$ref": "#/keycode_short"} | ||
| 102 | } | ||
| 103 | } | ||
| 104 | }, | ||
| 105 | "keycode_decl_array": { | ||
| 106 | "type": "array", | ||
| 107 | "minItems": 1 | ||
| 108 | "items": {"$ref": "#/keycode_decl"} | ||
| 109 | }, | ||
| 110 | "mcu_pin_array": { | ||
| 111 | "type": "array", | ||
| 112 | "items": {"$ref": "#/mcu_pin"} | ||
| 113 | }, | ||
| 114 | "mcu_pin": { | 124 | "mcu_pin": { |
| 115 | "oneOf": [ | 125 | "oneOf": [ |
| 116 | { | 126 | { |
| @@ -129,14 +139,14 @@ | |||
| 129 | "type": "string", | 139 | "type": "string", |
| 130 | "pattern": "^GP\\d{1,2}$" | 140 | "pattern": "^GP\\d{1,2}$" |
| 131 | }, | 141 | }, |
| 132 | { | 142 | {"type": "integer"}, |
| 133 | "type": "integer" | 143 | {"type": "null"} |
| 134 | }, | ||
| 135 | { | ||
| 136 | "type": "null" | ||
| 137 | } | ||
| 138 | ] | 144 | ] |
| 139 | }, | 145 | }, |
| 146 | "mcu_pin_array": { | ||
| 147 | "type": "array", | ||
| 148 | "items": {"$ref": "#/mcu_pin"} | ||
| 149 | }, | ||
| 140 | "signed_decimal": { | 150 | "signed_decimal": { |
| 141 | "type": "number" | 151 | "type": "number" |
| 142 | }, | 152 | }, |
| @@ -148,17 +158,22 @@ | |||
| 148 | "minimum": -127, | 158 | "minimum": -127, |
| 149 | "maximum": 127 | 159 | "maximum": 127 |
| 150 | }, | 160 | }, |
| 161 | "snake_case": { | ||
| 162 | "type": "string", | ||
| 163 | "pattern": "^[a-z][a-z0-9_]*$" | ||
| 164 | }, | ||
| 151 | "string_array": { | 165 | "string_array": { |
| 152 | "type": "array", | 166 | "type": "array", |
| 153 | "items": { | 167 | "items": {"type": "string"} |
| 154 | "type": "string" | ||
| 155 | } | ||
| 156 | }, | 168 | }, |
| 157 | "string_object": { | 169 | "string_object": { |
| 158 | "type": "object", | 170 | "type": "object", |
| 159 | "additionalProperties": { | 171 | "additionalProperties": {"type": "string"} |
| 160 | "type": "string" | 172 | }, |
| 161 | } | 173 | "text_identifier": { |
| 174 | "type": "string", | ||
| 175 | "minLength": 1, | ||
| 176 | "maxLength": 250 | ||
| 162 | }, | 177 | }, |
| 163 | "unsigned_decimal": { | 178 | "unsigned_decimal": { |
| 164 | "type": "number", | 179 | "type": "number", |
| @@ -172,28 +187,5 @@ | |||
| 172 | "type": "integer", | 187 | "type": "integer", |
| 173 | "minimum": 0, | 188 | "minimum": 0, |
| 174 | "maximum": 255 | 189 | "maximum": 255 |
| 175 | }, | ||
| 176 | "bit": { | ||
| 177 | "type": "integer", | ||
| 178 | "minimum": 0, | ||
| 179 | "maximum": 1 | ||
| 180 | }, | ||
| 181 | "keyboard_keymap_tuple": { | ||
| 182 | "type": "array", | ||
| 183 | "prefixItems": [ | ||
| 184 | { "$ref": "#/keyboard" }, | ||
| 185 | { "$ref": "#/filename" } | ||
| 186 | ], | ||
| 187 | "unevaluatedItems": false | ||
| 188 | }, | ||
| 189 | "json_file_path": { | ||
| 190 | "type": "string", | ||
| 191 | "pattern": "^[0-9a-z_/\\-]+\\.json$" | ||
| 192 | }, | ||
| 193 | "build_target": { | ||
| 194 | "oneOf": [ | ||
| 195 | { "$ref": "#/keyboard_keymap_tuple" }, | ||
| 196 | { "$ref": "#/json_file_path" } | ||
| 197 | ] | ||
| 198 | } | 190 | } |
| 199 | } | 191 | } |
