diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/schemas/api_keyboard.jsonschema | 35 | ||||
-rw-r--r-- | data/schemas/false.jsonschema | 1 | ||||
-rw-r--r-- | data/schemas/keyboard.jsonschema | 296 | ||||
-rw-r--r-- | data/schemas/true.jsonschema | 1 |
4 files changed, 333 insertions, 0 deletions
diff --git a/data/schemas/api_keyboard.jsonschema b/data/schemas/api_keyboard.jsonschema new file mode 100644 index 000000000..d570ee999 --- /dev/null +++ b/data/schemas/api_keyboard.jsonschema | |||
@@ -0,0 +1,35 @@ | |||
1 | { | ||
2 | "allOf": [ | ||
3 | { "$ref": "qmk.keyboard.v1" }, | ||
4 | { | ||
5 | "$id": "qmk.api.keyboard.v1", | ||
6 | "keymaps": { | ||
7 | "type": "string" | ||
8 | }, | ||
9 | "parse_errors": { | ||
10 | "type": "array", | ||
11 | "items": { | ||
12 | "type": "string" | ||
13 | } | ||
14 | }, | ||
15 | "parse_warnings": { | ||
16 | "type": "array", | ||
17 | "items": { | ||
18 | "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 | } | ||
33 | } | ||
34 | ] | ||
35 | } | ||
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..8f1c0a915 --- /dev/null +++ b/data/schemas/keyboard.jsonschema | |||
@@ -0,0 +1,296 @@ | |||
1 | { | ||
2 | "$schema": "http://json-schema.org/schema#", | ||
3 | "$id": "qmk.keyboard.v1", | ||
4 | "title": "Keyboard Information", | ||
5 | "type": "object", | ||
6 | "properties": { | ||
7 | "keyboard_name": { | ||
8 | "type": "string", | ||
9 | "minLength": 2, | ||
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": { | ||
23 | "type": "string", | ||
24 | "format": "uri" | ||
25 | }, | ||
26 | "processor": { | ||
27 | "type": "string", | ||
28 | "enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"] | ||
29 | }, | ||
30 | "board": { | ||
31 | "type": "string", | ||
32 | "minLength": 2, | ||
33 | "pattern": "^[a-zA-Z_][0-9a-zA-Z_]*$" | ||
34 | }, | ||
35 | "bootloader": { | ||
36 | "type": "string", | ||
37 | "enum": ["atmel-dfu", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "stm32-dfu", "stm32duino", "unknown", "USBasp"] | ||
38 | }, | ||
39 | "diode_direction": { | ||
40 | "type": "string", | ||
41 | "enum": ["COL2ROW", "ROW2COL"] | ||
42 | }, | ||
43 | "debounce": { | ||
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": { | ||
57 | "type": "array", | ||
58 | "items": { | ||
59 | "type": "string", | ||
60 | "minLength": 2, | ||
61 | "pattern": "^[0-9a-z_]*$" | ||
62 | } | ||
63 | }, | ||
64 | "features": { | ||
65 | "type": "object", | ||
66 | "additionalProperties": {"type": "boolean"} | ||
67 | }, | ||
68 | "indicators": { | ||
69 | "type": "object", | ||
70 | "properties": { | ||
71 | "caps_lock": { | ||
72 | "type": "string", | ||
73 | "pattern": "^[A-K]\\d{1,2}$" | ||
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 | } | ||
84 | }, | ||
85 | "layout_aliases": { | ||
86 | "type": "object", | ||
87 | "additionalProperties": { | ||
88 | "type": "string", | ||
89 | "pattern": "^LAYOUT_[0-9a-z_]*$" | ||
90 | } | ||
91 | }, | ||
92 | "layouts": { | ||
93 | "type": "object", | ||
94 | "additionalProperties": { | ||
95 | "type": "object", | ||
96 | "additionalProperties": false, | ||
97 | "properties": { | ||
98 | "filename": { | ||
99 | "type": "string" | ||
100 | }, | ||
101 | "c_macro": { | ||
102 | "type": "boolean" | ||
103 | }, | ||
104 | "key_count": { | ||
105 | "type": "number", | ||
106 | "min": 0, | ||
107 | "multipleOf": 1 | ||
108 | }, | ||
109 | "layout": { | ||
110 | "type": "array", | ||
111 | "items": { | ||
112 | "type": "object", | ||
113 | "additionalProperties": false, | ||
114 | "properties": { | ||
115 | "label": {"type": "string"}, | ||
116 | "matrix": { | ||
117 | "type": "array", | ||
118 | "minItems": 2, | ||
119 | "maxItems": 2, | ||
120 | "items": { | ||
121 | "type": "number", | ||
122 | "min": 0, | ||
123 | "multipleOf": 1 | ||
124 | } | ||
125 | }, | ||
126 | "h": { | ||
127 | "type": "number", | ||
128 | "min": 0.25 | ||
129 | }, | ||
130 | "r": { | ||
131 | "type": "number", | ||
132 | "min": 0 | ||
133 | }, | ||
134 | "rx": { | ||
135 | "type": "number", | ||
136 | "min": 0 | ||
137 | }, | ||
138 | "ry": { | ||
139 | "type": "number", | ||
140 | "min": 0 | ||
141 | }, | ||
142 | "w": { | ||
143 | "type": "number", | ||
144 | "min": 0.25 | ||
145 | }, | ||
146 | "x": { | ||
147 | "type": "number", | ||
148 | "min": 0 | ||
149 | }, | ||
150 | "y": { | ||
151 | "type": "number", | ||
152 | "min": 0 | ||
153 | } | ||
154 | } | ||
155 | } | ||
156 | } | ||
157 | } | ||
158 | } | ||
159 | }, | ||
160 | "matrix_pins": { | ||
161 | "type": "object", | ||
162 | "additionalProperties": false, | ||
163 | "properties": { | ||
164 | "direct": { | ||
165 | "type": "array", | ||
166 | "items": { | ||
167 | "type": "array", | ||
168 | "items": { | ||
169 | "oneOf": [ | ||
170 | { | ||
171 | "type": "string", | ||
172 | "pattern": "^[A-K]\\d{1,2}$" | ||
173 | }, | ||
174 | { | ||
175 | "type": "number", | ||
176 | "multipleOf": 1 | ||
177 | }, | ||
178 | { | ||
179 | "type": "null" | ||
180 | } | ||
181 | ] | ||
182 | } | ||
183 | } | ||
184 | }, | ||
185 | "cols": { | ||
186 | "type": "array", | ||
187 | "items": { | ||
188 | "oneOf": [ | ||
189 | { | ||
190 | "type": "string", | ||
191 | "pattern": "^[A-K]\\d{1,2}$" | ||
192 | }, | ||
193 | { | ||
194 | "type": "number", | ||
195 | "multipleOf": 1 | ||
196 | }, | ||
197 | { | ||
198 | "type": "null" | ||
199 | } | ||
200 | ] | ||
201 | } | ||
202 | }, | ||
203 | "rows": { | ||
204 | "type": "array", | ||
205 | "items": { | ||
206 | "oneOf": [ | ||
207 | { | ||
208 | "type": "string", | ||
209 | "pattern": "^[A-K]\\d{1,2}$" | ||
210 | }, | ||
211 | { | ||
212 | "type": "number", | ||
213 | "multipleOf": 1 | ||
214 | }, | ||
215 | { | ||
216 | "type": "null" | ||
217 | } | ||
218 | ] | ||
219 | } | ||
220 | } | ||
221 | } | ||
222 | }, | ||
223 | "rgblight": { | ||
224 | "type": "object", | ||
225 | "additionalProperties": false, | ||
226 | "properties": { | ||
227 | "animations": { | ||
228 | "type": "object", | ||
229 | "additionalProperties": { | ||
230 | "type": "boolean" | ||
231 | } | ||
232 | }, | ||
233 | "brightness_steps": { | ||
234 | "type": "number", | ||
235 | "min": 0, | ||
236 | "multipleOf": 1 | ||
237 | }, | ||
238 | "hue_steps": { | ||
239 | "type": "number", | ||
240 | "min": 0, | ||
241 | "multipleOf": 1 | ||
242 | }, | ||
243 | "led_count": { | ||
244 | "type": "number", | ||
245 | "min": 0, | ||
246 | "multipleOf": 1 | ||
247 | }, | ||
248 | "max_brightness": { | ||
249 | "type": "number", | ||
250 | "min": 0, | ||
251 | "max": 255, | ||
252 | "multipleOf": 1 | ||
253 | }, | ||
254 | "pin": { | ||
255 | "type": "string", | ||
256 | "pattern": "^[A-K]\\d{1,2}$" | ||
257 | }, | ||
258 | "saturation_steps": { | ||
259 | "type": "number", | ||
260 | "min": 0, | ||
261 | "multipleOf": 1 | ||
262 | }, | ||
263 | "sleep": {"type": "boolean"}, | ||
264 | "split": {"type": "boolean"}, | ||
265 | "split_count": { | ||
266 | "type": "array", | ||
267 | "minLength": 2, | ||
268 | "maxLength": 2, | ||
269 | "items": { | ||
270 | "type": "number", | ||
271 | "min": 0, | ||
272 | "multipleOf": 1 | ||
273 | } | ||
274 | } | ||
275 | } | ||
276 | }, | ||
277 | "usb": { | ||
278 | "type": "object", | ||
279 | "additionalProperties": false, | ||
280 | "properties": { | ||
281 | "device_ver": { | ||
282 | "type": "string", | ||
283 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
284 | }, | ||
285 | "pid": { | ||
286 | "type": "string", | ||
287 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
288 | }, | ||
289 | "vid": { | ||
290 | "type": "string", | ||
291 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
292 | } | ||
293 | } | ||
294 | } | ||
295 | } | ||
296 | } | ||
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 | |||