diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/schemas/api_keyboard.jsonschema | 44 | ||||
-rw-r--r-- | data/schemas/definitions.jsonschema | 107 | ||||
-rw-r--r-- | data/schemas/keyboard.jsonschema | 253 |
3 files changed, 162 insertions, 242 deletions
diff --git a/data/schemas/api_keyboard.jsonschema b/data/schemas/api_keyboard.jsonschema index d570ee999..d638658a1 100644 --- a/data/schemas/api_keyboard.jsonschema +++ b/data/schemas/api_keyboard.jsonschema | |||
@@ -1,34 +1,22 @@ | |||
1 | { | 1 | { |
2 | "$id": "qmk.api.keyboard.v1", | ||
2 | "allOf": [ | 3 | "allOf": [ |
3 | { "$ref": "qmk.keyboard.v1" }, | 4 | {"$ref": "qmk.keyboard.v1"}, |
4 | { | 5 | { |
5 | "$id": "qmk.api.keyboard.v1", | 6 | "properties": { |
6 | "keymaps": { | 7 | "keymaps": { |
7 | "type": "string" | 8 | "type": "object", |
8 | }, | 9 | "properties": { |
9 | "parse_errors": { | 10 | "url": {"type": "string"} |
10 | "type": "array", | 11 | } |
11 | "items": { | 12 | |
12 | "type": "string" | 13 | }, |
13 | } | 14 | "parse_errors": {"$ref": "qmk.definitions.v1#/string_array"}, |
14 | }, | 15 | "parse_warnings": {"$ref": "qmk.definitions.v1#/string_array"}, |
15 | "parse_warnings": { | 16 | "processor_type": {"type": "string"}, |
16 | "type": "array", | 17 | "protocol": {"type": "string"}, |
17 | "items": { | 18 | "keyboard_folder": {"type": "string"}, |
18 | "type": "string" | 19 | "platform": {"type": "string"} |
19 | } | ||
20 | }, | ||
21 | "processor_type": { | ||
22 | "type": "string" | ||
23 | }, | ||
24 | "protocol": { | ||
25 | "type": "string" | ||
26 | }, | ||
27 | "keyboard_folder": { | ||
28 | "type": "string" | ||
29 | }, | ||
30 | "platform": { | ||
31 | "type": "string" | ||
32 | } | 20 | } |
33 | } | 21 | } |
34 | ] | 22 | ] |
diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema new file mode 100644 index 000000000..822f23707 --- /dev/null +++ b/data/schemas/definitions.jsonschema | |||
@@ -0,0 +1,107 @@ | |||
1 | { | ||
2 | "$schema": "http://json-schema.org/draft-07/schema#", | ||
3 | "$id": "qmk.definitions.v1", | ||
4 | "title": "Common definitions used across QMK's jsonschemas.", | ||
5 | "type": "object", | ||
6 | "boolean_array": { | ||
7 | "type": "object", | ||
8 | "additionalProperties": {"type": "boolean"} | ||
9 | }, | ||
10 | "filename": { | ||
11 | "type": "string", | ||
12 | "minLength": 1, | ||
13 | "pattern": "^[0-9a-z_]*$" | ||
14 | }, | ||
15 | "hex_number_2d": { | ||
16 | "type": "string", | ||
17 | "pattern": "^0x[0-9A-F]{2}$" | ||
18 | }, | ||
19 | "hex_number_4d": { | ||
20 | "type": "string", | ||
21 | "pattern": "^0x[0-9A-F]{4}$" | ||
22 | }, | ||
23 | "text_identifier": { | ||
24 | "type": "string", | ||
25 | "minLength": 1, | ||
26 | "maxLength": 250 | ||
27 | }, | ||
28 | "layout_macro": { | ||
29 | "oneOf": [ | ||
30 | { | ||
31 | "type": "string", | ||
32 | "enum": ["LAYOUT", "LAYOUT_planck_1x2uC"] | ||
33 | }, | ||
34 | { | ||
35 | "type": "string", | ||
36 | "pattern": "^LAYOUT_[0-9a-z_]*$" | ||
37 | } | ||
38 | ] | ||
39 | }, | ||
40 | "key_unit": { | ||
41 | "type": "number", | ||
42 | "min": 0.25 | ||
43 | }, | ||
44 | "mcu_pin_array": { | ||
45 | "type": "array", | ||
46 | "items": {"$ref": "#/mcu_pin"} | ||
47 | }, | ||
48 | "mcu_pin": { | ||
49 | "oneOf": [ | ||
50 | { | ||
51 | "type": "string", | ||
52 | "pattern": "^[A-K]\\d{1,2}$" | ||
53 | }, | ||
54 | { | ||
55 | "type": "string", | ||
56 | "pattern": "^LINE_PIN\\d{1,2}$" | ||
57 | }, | ||
58 | { | ||
59 | "type": "number", | ||
60 | "multipleOf": 1 | ||
61 | }, | ||
62 | { | ||
63 | "type": "null" | ||
64 | } | ||
65 | ] | ||
66 | }, | ||
67 | "signed_decimal": { | ||
68 | "type": "number" | ||
69 | }, | ||
70 | "signed_int": { | ||
71 | "type": "number", | ||
72 | "multipleOf": 1 | ||
73 | } | ||
74 | "signed_int_8": { | ||
75 | "type": "number", | ||
76 | "min": -127, | ||
77 | "max": 127, | ||
78 | "multipleOf": 1 | ||
79 | } | ||
80 | "string_array": { | ||
81 | "type": "array", | ||
82 | "items": { | ||
83 | "type": "string" | ||
84 | } | ||
85 | }, | ||
86 | "string_object": { | ||
87 | "type": "object", | ||
88 | "additionalProperties": { | ||
89 | "type": "string" | ||
90 | } | ||
91 | }, | ||
92 | "unsigned_decimal": { | ||
93 | "type": "number", | ||
94 | "min": 0 | ||
95 | }, | ||
96 | "unsigned_int": { | ||
97 | "type": "number", | ||
98 | "min": 0, | ||
99 | "multipleOf": 1 | ||
100 | } | ||
101 | "unsigned_int_8": { | ||
102 | "type": "number", | ||
103 | "min": 0, | ||
104 | "max": 255, | ||
105 | "multipleOf": 1 | ||
106 | } | ||
107 | } | ||
diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index c335f49d5..3a3fa4b73 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema | |||
@@ -1,31 +1,19 @@ | |||
1 | { | 1 | { |
2 | "$schema": "http://json-schema.org/schema#", | 2 | "$schema": "http://json-schema.org/draft-07/schema#", |
3 | "$id": "qmk.keyboard.v1", | 3 | "$id": "qmk.keyboard.v1", |
4 | "title": "Keyboard Information", | 4 | "title": "Keyboard Information", |
5 | "type": "object", | 5 | "type": "object", |
6 | "properties": { | 6 | "properties": { |
7 | "keyboard_name": { | 7 | "keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"}, |
8 | "type": "string", | 8 | "maintainer": {"$ref": "qmk.definitions.v1#/text_identifier"}, |
9 | "minLength": 2, | 9 | "manufacturer": {"$ref": "qmk.definitions.v1#/text_identifier"}, |
10 | "maxLength": 250 | ||
11 | }, | ||
12 | "maintainer": { | ||
13 | "type": "string", | ||
14 | "minLength": 2, | ||
15 | "maxLength": 250 | ||
16 | }, | ||
17 | "manufacturer": { | ||
18 | "type": "string", | ||
19 | "minLength": 2, | ||
20 | "maxLength": 250 | ||
21 | }, | ||
22 | "url": { | 10 | "url": { |
23 | "type": "string", | 11 | "type": "string", |
24 | "format": "uri" | 12 | "format": "uri" |
25 | }, | 13 | }, |
26 | "processor": { | 14 | "processor": { |
27 | "type": "string", | 15 | "type": "string", |
28 | "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66F18", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L433", "STM32L443", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] | 16 | "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66F18", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L433", "STM32L443", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] |
29 | }, | 17 | }, |
30 | "board": { | 18 | "board": { |
31 | "type": "string", | 19 | "type": "string", |
@@ -34,68 +22,29 @@ | |||
34 | }, | 22 | }, |
35 | "bootloader": { | 23 | "bootloader": { |
36 | "type": "string", | 24 | "type": "string", |
37 | "enum": ["atmel-dfu", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "stm32-dfu", "stm32duino", "unknown", "USBasp", "tinyuf2"] | 25 | "enum": ["atmel-dfu", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "unknown", "USBasp", "tinyuf2"] |
38 | }, | 26 | }, |
39 | "diode_direction": { | 27 | "diode_direction": { |
40 | "type": "string", | 28 | "type": "string", |
41 | "enum": ["COL2ROW", "ROW2COL"] | 29 | "enum": ["COL2ROW", "ROW2COL"] |
42 | }, | 30 | }, |
43 | "debounce": { | 31 | "debounce": {"$ref": "qmk.definitions.v1#/unsigned_int"}, |
44 | "type": "number", | ||
45 | "min": 0, | ||
46 | "multipleOf": 1 | ||
47 | }, | ||
48 | "height": { | ||
49 | "type": "number", | ||
50 | "min": 0.25 | ||
51 | }, | ||
52 | "width": { | ||
53 | "type": "number", | ||
54 | "min": 0.25 | ||
55 | }, | ||
56 | "community_layouts": { | 32 | "community_layouts": { |
57 | "type": "array", | 33 | "type": "array", |
58 | "items": { | 34 | "items": {"$ref": "qmk.definitions.v1#/filename"} |
59 | "type": "string", | ||
60 | "minLength": 2, | ||
61 | "pattern": "^[0-9a-z_]*$" | ||
62 | } | ||
63 | }, | ||
64 | "features": { | ||
65 | "type": "object", | ||
66 | "additionalProperties": {"type": "boolean"} | ||
67 | }, | 35 | }, |
36 | "features": {"$ref": "qmk.definitions.v1#/boolean_array"}, | ||
68 | "indicators": { | 37 | "indicators": { |
69 | "type": "object", | 38 | "type": "object", |
70 | "properties": { | 39 | "properties": { |
71 | "caps_lock": { | 40 | "caps_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"}, |
72 | "type": "string", | 41 | "num_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"}, |
73 | "pattern": "^[A-K]\\d{1,2}$" | 42 | "scroll_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"} |
74 | }, | ||
75 | "num_lock": { | ||
76 | "type": "string", | ||
77 | "pattern": "^[A-K]\\d{1,2}$" | ||
78 | }, | ||
79 | "scroll_lock": { | ||
80 | "type": "string", | ||
81 | "pattern": "^[A-K]\\d{1,2}$" | ||
82 | } | ||
83 | } | 43 | } |
84 | }, | 44 | }, |
85 | "layout_aliases": { | 45 | "layout_aliases": { |
86 | "type": "object", | 46 | "type": "object", |
87 | "additionalProperties": { | 47 | "additionalProperties": {"$ref": "qmk.definitions.v1#/layout_macro"} |
88 | "oneOf": [ | ||
89 | { | ||
90 | "type": "string", | ||
91 | "enum": ["LAYOUT", "LAYOUT_planck_1x2uC"] | ||
92 | }, | ||
93 | { | ||
94 | "type": "string", | ||
95 | "pattern": "^LAYOUT_[0-9a-z_]*$" | ||
96 | } | ||
97 | ] | ||
98 | } | ||
99 | }, | 48 | }, |
100 | "layouts": { | 49 | "layouts": { |
101 | "type": "object", | 50 | "type": "object", |
@@ -109,11 +58,7 @@ | |||
109 | "c_macro": { | 58 | "c_macro": { |
110 | "type": "boolean" | 59 | "type": "boolean" |
111 | }, | 60 | }, |
112 | "key_count": { | 61 | "key_count": {"$ref": "qmk.definitions.v1#/key_unit"}, |
113 | "type": "number", | ||
114 | "min": 0, | ||
115 | "multipleOf": 1 | ||
116 | }, | ||
117 | "layout": { | 62 | "layout": { |
118 | "type": "array", | 63 | "type": "array", |
119 | "items": { | 64 | "items": { |
@@ -131,34 +76,14 @@ | |||
131 | "multipleOf": 1 | 76 | "multipleOf": 1 |
132 | } | 77 | } |
133 | }, | 78 | }, |
134 | "h": { | 79 | "key_count": {"$ref": "qmk.definitions.v1#/key_unit"}, |
135 | "type": "number", | 80 | "r": {"$ref": "qmk.definitions.v1#/unsigned_decimal"}, |
136 | "min": 0.25 | 81 | "rx": {"$ref": "qmk.definitions.v1#/unsigned_decimal"}, |
137 | }, | 82 | "ry": {"$ref": "qmk.definitions.v1#/unsigned_decimal"}, |
138 | "r": { | 83 | "h": {"$ref": "qmk.definitions.v1#/key_unit"}, |
139 | "type": "number", | 84 | "w": {"$ref": "qmk.definitions.v1#/key_unit"}, |
140 | "min": 0 | 85 | "x": {"$ref": "qmk.definitions.v1#/key_unit"}, |
141 | }, | 86 | "y": {"$ref": "qmk.definitions.v1#/key_unit"} |
142 | "rx": { | ||
143 | "type": "number", | ||
144 | "min": 0 | ||
145 | }, | ||
146 | "ry": { | ||
147 | "type": "number", | ||
148 | "min": 0 | ||
149 | }, | ||
150 | "w": { | ||
151 | "type": "number", | ||
152 | "min": 0.25 | ||
153 | }, | ||
154 | "x": { | ||
155 | "type": "number", | ||
156 | "min": 0 | ||
157 | }, | ||
158 | "y": { | ||
159 | "type": "number", | ||
160 | "min": 0 | ||
161 | } | ||
162 | } | 87 | } |
163 | } | 88 | } |
164 | } | 89 | } |
@@ -171,61 +96,10 @@ | |||
171 | "properties": { | 96 | "properties": { |
172 | "direct": { | 97 | "direct": { |
173 | "type": "array", | 98 | "type": "array", |
174 | "items": { | 99 | "items": {$ref": "qmk.definitions.v1#/mcu_pin_array"} |
175 | "type": "array", | ||
176 | "items": { | ||
177 | "oneOf": [ | ||
178 | { | ||
179 | "type": "string", | ||
180 | "pattern": "^[A-K]\\d{1,2}$" | ||
181 | }, | ||
182 | { | ||
183 | "type": "number", | ||
184 | "multipleOf": 1 | ||
185 | }, | ||
186 | { | ||
187 | "type": "null" | ||
188 | } | ||
189 | ] | ||
190 | } | ||
191 | } | ||
192 | }, | ||
193 | "cols": { | ||
194 | "type": "array", | ||
195 | "items": { | ||
196 | "oneOf": [ | ||
197 | { | ||
198 | "type": "string", | ||
199 | "pattern": "^[A-K]\\d{1,2}$" | ||
200 | }, | ||
201 | { | ||
202 | "type": "number", | ||
203 | "multipleOf": 1 | ||
204 | }, | ||
205 | { | ||
206 | "type": "null" | ||
207 | } | ||
208 | ] | ||
209 | } | ||
210 | }, | 100 | }, |
211 | "rows": { | 101 | "cols": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}, |
212 | "type": "array", | 102 | "rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} |
213 | "items": { | ||
214 | "oneOf": [ | ||
215 | { | ||
216 | "type": "string", | ||
217 | "pattern": "^[A-K]\\d{1,2}$" | ||
218 | }, | ||
219 | { | ||
220 | "type": "number", | ||
221 | "multipleOf": 1 | ||
222 | }, | ||
223 | { | ||
224 | "type": "null" | ||
225 | } | ||
226 | ] | ||
227 | } | ||
228 | } | ||
229 | } | 103 | } |
230 | }, | 104 | }, |
231 | "rgblight": { | 105 | "rgblight": { |
@@ -238,47 +112,19 @@ | |||
238 | "type": "boolean" | 112 | "type": "boolean" |
239 | } | 113 | } |
240 | }, | 114 | }, |
241 | "brightness_steps": { | 115 | "brightness_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, |
242 | "type": "number", | 116 | "hue_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, |
243 | "min": 0, | 117 | "led_count": {"$ref": "qmk.definitions.v1#/unsigned_int"}, |
244 | "multipleOf": 1 | 118 | "max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}, |
245 | }, | 119 | "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, |
246 | "hue_steps": { | 120 | "saturation_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"}, |
247 | "type": "number", | ||
248 | "min": 0, | ||
249 | "multipleOf": 1 | ||
250 | }, | ||
251 | "led_count": { | ||
252 | "type": "number", | ||
253 | "min": 0, | ||
254 | "multipleOf": 1 | ||
255 | }, | ||
256 | "max_brightness": { | ||
257 | "type": "number", | ||
258 | "min": 0, | ||
259 | "max": 255, | ||
260 | "multipleOf": 1 | ||
261 | }, | ||
262 | "pin": { | ||
263 | "type": "string", | ||
264 | "pattern": "^[A-K]\\d{1,2}$" | ||
265 | }, | ||
266 | "saturation_steps": { | ||
267 | "type": "number", | ||
268 | "min": 0, | ||
269 | "multipleOf": 1 | ||
270 | }, | ||
271 | "sleep": {"type": "boolean"}, | 121 | "sleep": {"type": "boolean"}, |
272 | "split": {"type": "boolean"}, | 122 | "split": {"type": "boolean"}, |
273 | "split_count": { | 123 | "split_count": { |
274 | "type": "array", | 124 | "type": "array", |
275 | "minLength": 2, | 125 | "minLength": 2, |
276 | "maxLength": 2, | 126 | "maxLength": 2, |
277 | "items": { | 127 | "items": {"$ref": "qmk.definitions.v1#/unsigned_int"} |
278 | "type": "number", | ||
279 | "min": 0, | ||
280 | "multipleOf": 1 | ||
281 | } | ||
282 | } | 128 | } |
283 | } | 129 | } |
284 | }, | 130 | }, |
@@ -286,40 +132,19 @@ | |||
286 | "type": "object", | 132 | "type": "object", |
287 | "additionalProperties": false, | 133 | "additionalProperties": false, |
288 | "properties": { | 134 | "properties": { |
289 | "device_ver": { | 135 | "device_ver": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, |
290 | "type": "string", | 136 | "pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"}, |
291 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | 137 | "vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"} |
292 | }, | ||
293 | "pid": { | ||
294 | "type": "string", | ||
295 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
296 | }, | ||
297 | "vid": { | ||
298 | "type": "string", | ||
299 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
300 | } | ||
301 | } | 138 | } |
302 | }, | 139 | }, |
303 | "qmk_lufa_bootloader": { | 140 | "qmk_lufa_bootloader": { |
304 | "type": "object", | 141 | "type": "object", |
305 | "additionalProperties": false, | 142 | "additionalProperties": false, |
306 | "properties": { | 143 | "properties": { |
307 | "esc_output": { | 144 | "esc_output": {"$ref": "qmk.definitions.v1#/mcu_pin"}, |
308 | "type": "string", | 145 | "esc_input": {"$ref": "qmk.definitions.v1#/mcu_pin"}, |
309 | "pattern": "^[A-K]\\d{1,2}$" | 146 | "led": {"$ref": "qmk.definitions.v1#/mcu_pin"}, |
310 | }, | 147 | "speaker": {"$ref": "qmk.definitions.v1#/mcu_pin"} |
311 | "esc_input": { | ||
312 | "type": "string", | ||
313 | "pattern": "^[A-K]\\d{1,2}$" | ||
314 | }, | ||
315 | "led": { | ||
316 | "type": "string", | ||
317 | "pattern": "^[A-K]\\d{1,2}$" | ||
318 | }, | ||
319 | "speaker": { | ||
320 | "type": "string", | ||
321 | "pattern": "^[A-K]\\d{1,2}$" | ||
322 | } | ||
323 | } | 148 | } |
324 | } | 149 | } |
325 | } | 150 | } |