diff options
Diffstat (limited to 'data/schemas/definitions.jsonschema')
| -rw-r--r-- | data/schemas/definitions.jsonschema | 107 |
1 files changed, 107 insertions, 0 deletions
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 | } | ||
