aboutsummaryrefslogtreecommitdiff
path: root/data/schemas
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-04-10 12:13:40 +0100
committerAkshay <[email protected]>2022-04-10 12:13:40 +0100
commitdc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch)
tree4ccb8fa5886b66fa9d480edef74236c27f035e16 /data/schemas
Diffstat (limited to 'data/schemas')
-rw-r--r--data/schemas/api_keyboard.jsonschema23
-rw-r--r--data/schemas/definitions.jsonschema107
-rw-r--r--data/schemas/false.jsonschema1
-rw-r--r--data/schemas/keyboard.jsonschema362
-rw-r--r--data/schemas/keymap.jsonschema57
-rw-r--r--data/schemas/true.jsonschema1
6 files changed, 551 insertions, 0 deletions
diff --git a/data/schemas/api_keyboard.jsonschema b/data/schemas/api_keyboard.jsonschema
new file mode 100644
index 000000000..d638658a1
--- /dev/null
+++ b/data/schemas/api_keyboard.jsonschema
@@ -0,0 +1,23 @@
1{
2 "$id": "qmk.api.keyboard.v1",
3 "allOf": [
4 {"$ref": "qmk.keyboard.v1"},
5 {
6 "properties": {
7 "keymaps": {
8 "type": "object",
9 "properties": {
10 "url": {"type": "string"}
11 }
12
13 },
14 "parse_errors": {"$ref": "qmk.definitions.v1#/string_array"},
15 "parse_warnings": {"$ref": "qmk.definitions.v1#/string_array"},
16 "processor_type": {"type": "string"},
17 "protocol": {"type": "string"},
18 "keyboard_folder": {"type": "string"},
19 "platform": {"type": "string"}
20 }
21 }
22 ]
23}
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/false.jsonschema b/data/schemas/false.jsonschema
new file mode 100644
index 000000000..c508d5366
--- /dev/null
+++ b/data/schemas/false.jsonschema
@@ -0,0 +1 @@
false
diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema
new file mode 100644
index 000000000..308f9b782
--- /dev/null
+++ b/data/schemas/keyboard.jsonschema
@@ -0,0 +1,362 @@
1{
2 "$schema": "http://json-schema.org/draft-07/schema#",
3 "$id": "qmk.keyboard.v1",
4 "title": "Keyboard Information",
5 "type": "object",
6 "properties": {
7 "keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"},
8 "maintainer": {"$ref": "qmk.definitions.v1#/text_identifier"},
9 "manufacturer": {"$ref": "qmk.definitions.v1#/text_identifier"},
10 "url": {
11 "type": "string",
12 "format": "uri"
13 },
14 "processor": {
15 "type": "string",
16 "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66FX1M0", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F405", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L433", "STM32L443", "GD32VF103", "WB32F3G71", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"]
17 },
18 "audio": {
19 "type": "object",
20 "additionalProperties": false,
21 "properties": {
22 "macro_beep": {"type": "boolean"},
23 "pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
24 "voices": {"type": "boolean"}
25 }
26 },
27 "backlight": {
28 "type": "object",
29 "additionalProperties": false,
30 "properties": {
31 "breathing": {"type": "boolean"},
32 "breathing_period": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
33 "levels": {
34 "type": "number",
35 "min": 1,
36 "max": 31,
37 "multipleOf": 1
38 },
39 "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}
40 }
41 },
42 "bluetooth": {
43 "type": "object",
44 "additionalProperties": false,
45 "properties": {
46 "driver": {
47 "type": "string",
48 "enum": ["AdafruitBLE", "RN42"]
49 },
50 "lto": {"type": "boolean"},
51 }
52 },
53 "board": {
54 "type": "string",
55 "minLength": 2,
56 "pattern": "^[a-zA-Z_][0-9a-zA-Z_]*$"
57 },
58 "bootloader": {
59 "type": "string",
60 "enum": ["atmel-dfu", "bootloadhid", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "gd32v-dfu", "wb32-dfu", "unknown", "usbasploader", "USBasp", "tinyuf2"],
61 },
62 "bootloader_instructions": {
63 "type": "string",
64 "description": "Instructions for putting the keyboard into a mode that allows for firmware flashing."
65 },
66 "build": {
67 "type": "object",
68 "additionalProperties": false,
69 "properties": {
70 "debounce_type": {
71 "type": "string",
72 "enum": ["custom", "eager_pk", "eager_pr", "sym_defer_pk", "sym_eager_pk"]
73 },
74 "firmware_format": {
75 "type": "string",
76 "enum": ["bin", "hex", "uf2"]
77 },
78 "lto": {"type": "boolean"},
79 }
80 },
81 "diode_direction": {
82 "type": "string",
83 "enum": ["COL2ROW", "ROW2COL"]
84 },
85 "debounce": {"$ref": "qmk.definitions.v1#/unsigned_int"},
86 "combo": {
87 "type": "object",
88 "properties": {
89 "count": {"$ref": "qmk.definitions.v1#/unsigned_int"},
90 "term": {"$ref": "qmk.definitions.v1#/unsigned_int"}
91 }
92 },
93 "community_layouts": {
94 "type": "array",
95 "items": {"$ref": "qmk.definitions.v1#/filename"}
96 },
97 "features": {"$ref": "qmk.definitions.v1#/boolean_array"},
98 "indicators": {
99 "type": "object",
100 "properties": {
101 "caps_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
102 "num_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
103 "scroll_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"}
104 }
105 },
106 "layout_aliases": {
107 "type": "object",
108 "additionalProperties": {"$ref": "qmk.definitions.v1#/layout_macro"}
109 },
110 "layouts": {
111 "type": "object",
112 "additionalProperties": {
113 "type": "object",
114 "additionalProperties": false,
115 "properties": {
116 "filename": {
117 "type": "string"
118 },
119 "c_macro": {
120 "type": "boolean"
121 },
122 "layout": {
123 "type": "array",
124 "items": {
125 "type": "object",
126 "additionalProperties": false,
127 "properties": {
128 "label": {"type": "string"},
129 "matrix": {
130 "type": "array",
131 "minItems": 2,
132 "maxItems": 2,
133 "items": {
134 "type": "number",
135 "min": 0,
136 "multipleOf": 1
137 }
138 },
139 "r": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
140 "rx": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
141 "ry": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
142 "h": {"$ref": "qmk.definitions.v1#/key_unit"},
143 "w": {"$ref": "qmk.definitions.v1#/key_unit"},
144 "x": {"$ref": "qmk.definitions.v1#/key_unit"},
145 "y": {"$ref": "qmk.definitions.v1#/key_unit"}
146 }
147 }
148 }
149 }
150 }
151 },
152 "leader_key": {
153 "type": "object",
154 "properties": {
155 "timing": {"type": "boolean"},
156 "strict_processing": {"type": "boolean"},
157 "timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}
158 }
159 },
160 "matrix_pins": {
161 "type": "object",
162 "additionalProperties": false,
163 "properties": {
164 "custom": {"type": "boolean"},
165 "custom_lite": {"type": "boolean"},
166 "ghost": {"type": "boolean"},
167 "io_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"},
168 "direct": {
169 "type": "array",
170 "items": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}
171 },
172 "cols": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
173 "rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
174 "unused": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}
175 }
176 },
177 "mouse_key": {
178 "type": "object",
179 "properties": {
180 "enabled": {"type": "boolean"},
181 "delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
182 "interval": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
183 "max_speed": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
184 "time_to_max": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
185 "wheel_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
186 }
187 },
188 "oneshot": {
189 "type": "object",
190 "properties": {
191 "tap_toggle": {"$ref": "qmk.definitions.v1#/unsigned_int"},
192 "timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}
193 }
194 },
195 "rgblight": {
196 "type": "object",
197 "additionalProperties": false,
198 "properties": {
199 "animations": {
200 "type": "object",
201 "additionalProperties": {
202 "type": "boolean"
203 }
204 },
205 "brightness_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"},
206 "hue_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"},
207 "layers": {
208 "type": "object",
209 "additionalProperties": false,
210 "properties": {
211 "blink": {"type": "boolean"},
212 "enabled": {"type": "boolean"},
213 "max": {
214 "type": "number",
215 "min": 1,
216 "max": 32,
217 "multipleOf": 1
218 },
219 "override_rgb": {"type": "boolean"}
220 }
221 },
222 "led_count": {"$ref": "qmk.definitions.v1#/unsigned_int"},
223 "max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
224 "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
225 "rgbw": {"type": "boolean"},
226 "saturation_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"},
227 "sleep": {"type": "boolean"},
228 "split": {"type": "boolean"},
229 "split_count": {
230 "type": "array",
231 "minLength": 2,
232 "maxLength": 2,
233 "items": {"$ref": "qmk.definitions.v1#/unsigned_int"}
234 }
235 }
236 },
237 "split": {
238 "type": "object",
239 "additionalProperties": false,
240 "properties": {
241 "enabled": {"type": "boolean"},
242 "matrix_grid": {
243 "type": "array",
244 "items": {"$ref": "qmk.definitions.v1#/mcu_pin"}
245 },
246 "matrix_pins": {
247 "type": "object",
248 "additionalProperties": false,
249 "properties": {
250 "right": {
251 "type": "object",
252 "additionalProperties": false,
253 "properties": {
254 "direct": {
255 "type": "array",
256 "items": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}
257 },
258 "cols": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
259 "rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
260 "unused": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}
261 }
262 }
263 }
264 },
265 "main": {
266 "type": "string",
267 "enum": ["eeprom", "left", "matrix_grid", "pin", "right"]
268 },
269 "soft_serial_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
270 "soft_serial_speed": {
271 "type": "number",
272 "min": 0,
273 "max": 5,
274 "multipleOf": 1
275 },
276 "transport": {
277 "type": "object",
278 "additionalProperties": false,
279 "properties": {
280 "protocol": {
281 "type": "string",
282 "enum": ["custom", "i2c", "serial", "serial_usart"]
283 },
284 "sync_matrix_state": {"type": "boolean"},
285 "sync_modifiers": {"type": "boolean"}
286 }
287 },
288 "usb_detect": {
289 "type": "object",
290 "additionalProperties": false,
291 "properties": {
292 "enabled": {"type": "boolean"},
293 "polling_interval": {"$ref": "qmk.definitions.v1#/unsigned_int"},
294 "timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}
295 }
296 }
297 }
298 },
299 "tags": {
300 "type": "array",
301 "items": {"type": "string"}
302 },
303 "tapping": {
304 "type": "object",
305 "properties": {
306 "force_hold": {"type": "boolean"},
307 "force_hold_per_key": {"type": "boolean"},
308 "ignore_mod_tap_interrupt": {"type": "boolean"},
309 "ignore_mod_tap_interrupt_per_key": {"type": "boolean"},
310 "permissive_hold": {"type": "boolean"},
311 "permissive_hold_per_key": {"type": "boolean"},
312 "retro": {"type": "boolean"},
313 "retro_per_key": {"type": "boolean"},
314 "term": {"$ref": "qmk.definitions.v1#/unsigned_int"},
315 "term_per_key": {"type": "boolean"},
316 "toggle": {"$ref": "qmk.definitions.v1#/unsigned_int"},
317 }
318 },
319 "usb": {
320 "type": "object",
321 "additionalProperties": false,
322 "properties": {
323 "device_ver": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
324 "force_nkro": {"type": "boolean"},
325 "pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
326 "vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
327 "max_power": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
328 "no_startup_check": {"type": "boolean"},
329 "polling_interval": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
330 "shared_endpoint": {
331 "type": "object",
332 "additionalProperties": false,
333 "properties": {
334 "keyboard": {"type": "boolean"},
335 "mouse": {"type": "boolean"}
336 }
337 },
338 "suspend_wakeup_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
339 "wait_for": {"type": "boolean"},
340 }
341 },
342 "qmk": {
343 "type": "object",
344 "additionalProperties": false,
345 "properties": {
346 "keys_per_scan": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
347 "tap_keycode_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
348 "tap_capslock_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
349 }
350 },
351 "qmk_lufa_bootloader": {
352 "type": "object",
353 "additionalProperties": false,
354 "properties": {
355 "esc_output": {"$ref": "qmk.definitions.v1#/mcu_pin"},
356 "esc_input": {"$ref": "qmk.definitions.v1#/mcu_pin"},
357 "led": {"$ref": "qmk.definitions.v1#/mcu_pin"},
358 "speaker": {"$ref": "qmk.definitions.v1#/mcu_pin"}
359 }
360 }
361 }
362}
diff --git a/data/schemas/keymap.jsonschema b/data/schemas/keymap.jsonschema
new file mode 100644
index 000000000..faa250a94
--- /dev/null
+++ b/data/schemas/keymap.jsonschema
@@ -0,0 +1,57 @@
1{
2 "$schema": "http://json-schema.org/draft-07/schema#",
3 "$id": "qmk.keymap.v1",
4 "title": "Keymap Information",
5 "type": "object",
6 "properties": {
7 "author": {"type": "string"},
8 "host_language": {"$ref": "qmk.definitions.v1#/text_identifier"},
9 "keyboard": {"$ref": "qmk.definitions.v1#/text_identifier"},
10 "keymap": {"$ref": "qmk.definitions.v1#/text_identifier"},
11 "layout": {"$ref": "qmk.definitions.v1#/layout_macro"},
12 "layers": {
13 "type": "array",
14 "items": {
15 "type": "array",
16 "items": {"type": "string"}
17 }
18 },
19 "macros": {
20 "type": "array",
21 "items": {
22 "type": "array",
23 "items": {
24 "oneOf": [
25 {
26 "type": "string"
27 },
28 {
29 "type": "object",
30 "additionalProperties": false,
31 "properties": {
32 "action": {
33 "type": "string",
34 "enum": ['beep', 'delay', 'down', 'tap', 'up']
35 },
36 "keycodes": {
37 "type": "array",
38 "items": {
39 "$ref": "qmk.definitions.v1#/text_identifier"
40 }
41 },
42 "duration": {
43 "$ref": "qmk.definitions.v1#/unsigned_int"
44 }
45 }
46 }
47 ]
48 }
49 }
50 },
51 "config": {"$ref": "qmk.keyboard.v1"},
52 "notes": {
53 "type": "string",
54 "description": "asdf"
55 }
56 }
57}
diff --git a/data/schemas/true.jsonschema b/data/schemas/true.jsonschema
new file mode 100644
index 000000000..27ba77dda
--- /dev/null
+++ b/data/schemas/true.jsonschema
@@ -0,0 +1 @@
true