diff options
-rw-r--r-- | data/schemas/api_keyboard.jsonschema | 35 | ||||
-rw-r--r-- | data/schemas/false.jsonschema | 1 | ||||
-rw-r--r-- | data/schemas/keyboard.jsonschema | 232 | ||||
-rw-r--r-- | data/schemas/true.jsonschema | 1 |
4 files changed, 269 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..75e792b64 --- /dev/null +++ b/data/schemas/keyboard.jsonschema | |||
@@ -0,0 +1,232 @@ | |||
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": ["MK20DX128", "MK20DX256", "MKL26Z64", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F411", "at90usb1286", "at90usb646", "atmega16u2", "atmega328p", "atmega32a", "atmega32u2", "atmega32u4", "attiny85", "cortex-m4"] | ||
29 | }, | ||
30 | "bootloader": { | ||
31 | "type": "string", | ||
32 | "enum": ["atmel-dfu", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "stm32-dfu", "stm32duino", "unknown", "USBasp"] | ||
33 | }, | ||
34 | "diode_direction": { | ||
35 | "type": "string", | ||
36 | "enum": ["COL2ROW", "ROW2COL"] | ||
37 | }, | ||
38 | "debounce": { | ||
39 | "type": "number", | ||
40 | "min": 0, | ||
41 | "multipleOf": 1 | ||
42 | }, | ||
43 | "height": { | ||
44 | "type": "number", | ||
45 | "min": 0.25 | ||
46 | }, | ||
47 | "width": { | ||
48 | "type": "number", | ||
49 | "min": 0.25 | ||
50 | }, | ||
51 | "community_layouts": { | ||
52 | "type": "array", | ||
53 | "items": { | ||
54 | "type": "string", | ||
55 | "minLength": 2, | ||
56 | "pattern": "^[0-9a-z_]*$" | ||
57 | } | ||
58 | }, | ||
59 | "features": { | ||
60 | "type": "object", | ||
61 | "additionalProperties": {"type": "boolean"} | ||
62 | }, | ||
63 | "indicators": { | ||
64 | "type": "object", | ||
65 | "properties": { | ||
66 | "caps_lock": { | ||
67 | "type": "string", | ||
68 | "pattern": "^[A-K]\\d{1,2}$" | ||
69 | }, | ||
70 | "num_lock": { | ||
71 | "type": "string", | ||
72 | "pattern": "^[A-K]\\d{1,2}$" | ||
73 | }, | ||
74 | "scroll_lock": { | ||
75 | "type": "string", | ||
76 | "pattern": "^[A-K]\\d{1,2}$" | ||
77 | } | ||
78 | } | ||
79 | }, | ||
80 | "layout_aliases": { | ||
81 | "type": "object", | ||
82 | "additionalProperties": { | ||
83 | "type": "string", | ||
84 | "pattern": "^LAYOUT_[0-9a-z_]*$" | ||
85 | } | ||
86 | }, | ||
87 | "layouts": { | ||
88 | "type": "object", | ||
89 | "additionalProperties": { | ||
90 | "type": "object", | ||
91 | "additionalProperties": false, | ||
92 | "properties": { | ||
93 | "c_macro": { | ||
94 | "type": "boolean" | ||
95 | }, | ||
96 | "key_count": { | ||
97 | "type": "number", | ||
98 | "min": 0, | ||
99 | "multipleOf": 1 | ||
100 | }, | ||
101 | "layout": { | ||
102 | "type": "array", | ||
103 | "items": { | ||
104 | "type": "object", | ||
105 | "additionalProperties": false, | ||
106 | "properties": { | ||
107 | "label": {"type": "string"}, | ||
108 | "matrix": { | ||
109 | "type": "array", | ||
110 | "minItems": 2, | ||
111 | "maxItems": 2, | ||
112 | "items": { | ||
113 | "type": "number", | ||
114 | "min": 0, | ||
115 | "multipleOf": 1 | ||
116 | } | ||
117 | }, | ||
118 | "h": { | ||
119 | "type": "number", | ||
120 | "min": 0.25 | ||
121 | }, | ||
122 | "w": { | ||
123 | "type": "number", | ||
124 | "min": 0.25 | ||
125 | }, | ||
126 | "x": { | ||
127 | "type": "number", | ||
128 | "min": 0 | ||
129 | }, | ||
130 | "y": { | ||
131 | "type": "number", | ||
132 | "min": 0 | ||
133 | } | ||
134 | } | ||
135 | } | ||
136 | } | ||
137 | } | ||
138 | } | ||
139 | }, | ||
140 | "matrix_pins": { | ||
141 | "type": "object", | ||
142 | "additionalProperties": false, | ||
143 | "properties": { | ||
144 | "direct": { | ||
145 | "type": "array", | ||
146 | "items": { | ||
147 | "type": "array", | ||
148 | "items": { | ||
149 | "oneOf": [ | ||
150 | { | ||
151 | "type": "string", | ||
152 | "pattern": "^[A-K]\\d{1,2}$" | ||
153 | }, | ||
154 | { | ||
155 | "type": "null" | ||
156 | } | ||
157 | ] | ||
158 | } | ||
159 | } | ||
160 | }, | ||
161 | "cols": { | ||
162 | "type": "array", | ||
163 | "items": { | ||
164 | "type": "string", | ||
165 | "pattern": "^[A-K]\\d{1,2}$" | ||
166 | } | ||
167 | }, | ||
168 | "rows": { | ||
169 | "type": "array", | ||
170 | "items": { | ||
171 | "type": "string", | ||
172 | "pattern": "^[A-K]\\d{1,2}$" | ||
173 | } | ||
174 | } | ||
175 | } | ||
176 | }, | ||
177 | "rgblight": { | ||
178 | "type": "object", | ||
179 | "additionalProperties": false, | ||
180 | "properties": { | ||
181 | "animations": { | ||
182 | "type": "object", | ||
183 | "additionalProperties": { | ||
184 | "type": "boolean" | ||
185 | } | ||
186 | }, | ||
187 | "brightness_steps": { | ||
188 | "type": "number", | ||
189 | "min": 0, | ||
190 | "multipleOf": 1 | ||
191 | }, | ||
192 | "hue_steps": { | ||
193 | "type": "number", | ||
194 | "min": 0, | ||
195 | "multipleOf": 1 | ||
196 | }, | ||
197 | "led_count": { | ||
198 | "type": "number", | ||
199 | "min": 0, | ||
200 | "multipleOf": 1 | ||
201 | }, | ||
202 | "pin": { | ||
203 | "type": "string", | ||
204 | "pattern": "^[A-K]\\d{1,2}$" | ||
205 | }, | ||
206 | "saturation_steps": { | ||
207 | "type": "number", | ||
208 | "min": 0, | ||
209 | "multipleOf": 1 | ||
210 | } | ||
211 | } | ||
212 | }, | ||
213 | "usb": { | ||
214 | "type": "object", | ||
215 | "additionalProperties": false, | ||
216 | "properties": { | ||
217 | "device_ver": { | ||
218 | "type": "string", | ||
219 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
220 | }, | ||
221 | "pid": { | ||
222 | "type": "string", | ||
223 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
224 | }, | ||
225 | "vid": { | ||
226 | "type": "string", | ||
227 | "pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" | ||
228 | } | ||
229 | } | ||
230 | } | ||
231 | } | ||
232 | } | ||
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 | |||