2021-06-25 11:48:53 +08:00
|
|
|
{
|
2022-06-18 13:30:46 +08:00
|
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema#",
|
2021-06-25 11:48:53 +08:00
|
|
|
"$id": "qmk.definitions.v1",
|
|
|
|
"title": "Common definitions used across QMK's jsonschemas.",
|
|
|
|
"type": "object",
|
2023-12-04 09:04:09 +08:00
|
|
|
"bcd_version": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$"
|
|
|
|
},
|
|
|
|
"bit": {
|
|
|
|
"type": "integer",
|
|
|
|
"minimum": 0,
|
|
|
|
"maximum": 1
|
|
|
|
},
|
2021-06-25 11:48:53 +08:00
|
|
|
"boolean_array": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": {"type": "boolean"}
|
|
|
|
},
|
2023-12-04 09:04:09 +08:00
|
|
|
"build_target": {
|
|
|
|
"oneOf": [
|
|
|
|
{"$ref": "#/keyboard_keymap_tuple"},
|
|
|
|
{"$ref": "#/json_file_path"}
|
|
|
|
]
|
|
|
|
},
|
2021-06-25 11:48:53 +08:00
|
|
|
"filename": {
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
"pattern": "^[0-9a-z_]*$"
|
|
|
|
},
|
|
|
|
"hex_number_2d": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^0x[0-9A-F]{2}$"
|
|
|
|
},
|
|
|
|
"hex_number_4d": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^0x[0-9A-F]{4}$"
|
|
|
|
},
|
2023-12-04 09:04:09 +08:00
|
|
|
"json_file_path": {
|
2022-01-17 05:44:34 +08:00
|
|
|
"type": "string",
|
2023-12-04 09:04:09 +08:00
|
|
|
"pattern": "^[0-9a-z_/\\-]+\\.json$"
|
2022-01-17 05:44:34 +08:00
|
|
|
},
|
2023-12-04 09:04:09 +08:00
|
|
|
"key_unit": {
|
2024-06-17 04:57:37 +08:00
|
|
|
"type": "number",
|
|
|
|
"minimum": 0
|
2023-12-04 09:04:09 +08:00
|
|
|
},
|
|
|
|
"keyboard": {
|
2021-06-25 11:48:53 +08:00
|
|
|
"type": "string",
|
2023-12-04 09:04:09 +08:00
|
|
|
"pattern": "^[0-9a-z][0-9a-z_/]*$"
|
2021-06-25 11:48:53 +08:00
|
|
|
},
|
2023-12-04 09:04:09 +08:00
|
|
|
"keyboard_keymap_tuple": {
|
|
|
|
"type": "array",
|
|
|
|
"prefixItems": [
|
|
|
|
{"$ref": "#/keyboard"},
|
|
|
|
{"$ref": "#/filename"}
|
|
|
|
],
|
|
|
|
"unevaluatedItems": false
|
|
|
|
},
|
|
|
|
"keycode": {
|
2023-09-20 21:13:51 +08:00
|
|
|
"type": "string",
|
2023-12-04 09:04:09 +08:00
|
|
|
"minLength": 2,
|
|
|
|
"maxLength": 50,
|
|
|
|
"pattern": "^[A-Z][A-Zs_0-9]*$"
|
|
|
|
},
|
|
|
|
"keycode_decl": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"key"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"key": {"$ref": "#/keycode"},
|
|
|
|
"label": {"$ref": "#/text_identifier"},
|
|
|
|
"aliases": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 1,
|
|
|
|
"items": {"$ref": "#/keycode_short"}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"keycode_decl_array": {
|
|
|
|
"type": "array",
|
|
|
|
"minItems": 1,
|
|
|
|
"items": {"$ref": "#/keycode_decl"}
|
|
|
|
},
|
|
|
|
"keycode_short": {
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 2,
|
|
|
|
"maxLength": 7,
|
|
|
|
"pattern": "^[A-Z][A-Zs_0-9]*$"
|
2023-09-20 21:13:51 +08:00
|
|
|
},
|
2021-06-25 11:48:53 +08:00
|
|
|
"layout_macro": {
|
|
|
|
"oneOf": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
2022-03-05 01:06:15 +08:00
|
|
|
"enum": [
|
|
|
|
"LAYOUT",
|
|
|
|
"LAYOUT_1x2uC",
|
|
|
|
"LAYOUT_1x2uL",
|
|
|
|
"LAYOUT_1x2uR",
|
|
|
|
"LAYOUT_2x2uC",
|
|
|
|
"LAYOUT_2x3uC",
|
|
|
|
"LAYOUT_625uC",
|
|
|
|
"LAYOUT_ortho_3x12_1x2uC",
|
|
|
|
"LAYOUT_ortho_4x12_1x2uC",
|
|
|
|
"LAYOUT_ortho_4x12_1x2uL",
|
|
|
|
"LAYOUT_ortho_4x12_1x2uR",
|
|
|
|
"LAYOUT_ortho_5x12_1x2uC",
|
|
|
|
"LAYOUT_ortho_5x12_2x2uC",
|
|
|
|
"LAYOUT_ortho_5x14_1x2uC",
|
|
|
|
"LAYOUT_ortho_5x14_1x2uL",
|
|
|
|
"LAYOUT_ortho_5x14_1x2uR",
|
|
|
|
"LAYOUT_planck_1x2uC",
|
|
|
|
"LAYOUT_planck_1x2uL",
|
|
|
|
"LAYOUT_planck_1x2uR",
|
|
|
|
"LAYOUT_preonic_1x2uC",
|
|
|
|
"LAYOUT_preonic_1x2uL",
|
2022-04-29 08:31:55 +08:00
|
|
|
"LAYOUT_preonic_1x2uR"
|
2022-03-05 01:06:15 +08:00
|
|
|
]
|
2021-06-25 11:48:53 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^LAYOUT_[0-9a-z_]*$"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"mcu_pin": {
|
|
|
|
"oneOf": [
|
2022-02-15 12:41:16 +08:00
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"enum": ["NO_PIN"]
|
|
|
|
},
|
2021-06-25 11:48:53 +08:00
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^[A-K]\\d{1,2}$"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^LINE_PIN\\d{1,2}$"
|
|
|
|
},
|
2022-06-30 19:19:27 +08:00
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^GP\\d{1,2}$"
|
|
|
|
},
|
2023-12-04 09:04:09 +08:00
|
|
|
{"type": "integer"},
|
|
|
|
{"type": "null"}
|
2021-06-25 11:48:53 +08:00
|
|
|
]
|
|
|
|
},
|
2023-12-04 09:04:09 +08:00
|
|
|
"mcu_pin_array": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {"$ref": "#/mcu_pin"}
|
|
|
|
},
|
2021-06-25 11:48:53 +08:00
|
|
|
"signed_decimal": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"signed_int": {
|
2022-06-18 13:30:46 +08:00
|
|
|
"type": "integer"
|
2022-01-17 05:44:34 +08:00
|
|
|
},
|
2021-06-25 11:48:53 +08:00
|
|
|
"signed_int_8": {
|
2022-06-18 13:30:46 +08:00
|
|
|
"type": "integer",
|
|
|
|
"minimum": -127,
|
|
|
|
"maximum": 127
|
2022-01-17 05:44:34 +08:00
|
|
|
},
|
2023-12-04 09:04:09 +08:00
|
|
|
"snake_case": {
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^[a-z][a-z0-9_]*$"
|
|
|
|
},
|
2021-06-25 11:48:53 +08:00
|
|
|
"string_array": {
|
|
|
|
"type": "array",
|
2023-12-04 09:04:09 +08:00
|
|
|
"items": {"type": "string"}
|
2021-06-25 11:48:53 +08:00
|
|
|
},
|
|
|
|
"string_object": {
|
|
|
|
"type": "object",
|
2023-12-04 09:04:09 +08:00
|
|
|
"additionalProperties": {"type": "string"}
|
|
|
|
},
|
|
|
|
"text_identifier": {
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
"maxLength": 250
|
2021-06-25 11:48:53 +08:00
|
|
|
},
|
|
|
|
"unsigned_decimal": {
|
|
|
|
"type": "number",
|
2022-06-18 13:30:46 +08:00
|
|
|
"minimum": 0
|
2021-06-25 11:48:53 +08:00
|
|
|
},
|
|
|
|
"unsigned_int": {
|
2022-06-18 13:30:46 +08:00
|
|
|
"type": "integer",
|
|
|
|
"minimum": 0
|
2022-01-17 05:44:34 +08:00
|
|
|
},
|
2021-06-25 11:48:53 +08:00
|
|
|
"unsigned_int_8": {
|
2022-06-18 13:30:46 +08:00
|
|
|
"type": "integer",
|
|
|
|
"minimum": 0,
|
|
|
|
"maximum": 255
|
2021-06-25 11:48:53 +08:00
|
|
|
}
|
|
|
|
}
|