Sort definitions.jsonschema (#22588)

This commit is contained in:
Ryan 2023-12-04 12:04:09 +11:00 committed by GitHub
parent 8895b13583
commit 33ff722ec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,10 +3,25 @@
"$id": "qmk.definitions.v1", "$id": "qmk.definitions.v1",
"title": "Common definitions used across QMK's jsonschemas.", "title": "Common definitions used across QMK's jsonschemas.",
"type": "object", "type": "object",
"bcd_version": {
"type": "string",
"pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$"
},
"bit": {
"type": "integer",
"minimum": 0,
"maximum": 1
},
"boolean_array": { "boolean_array": {
"type": "object", "type": "object",
"additionalProperties": {"type": "boolean"} "additionalProperties": {"type": "boolean"}
}, },
"build_target": {
"oneOf": [
{"$ref": "#/keyboard_keymap_tuple"},
{"$ref": "#/json_file_path"}
]
},
"filename": { "filename": {
"type": "string", "type": "string",
"minLength": 1, "minLength": 1,
@ -20,18 +35,56 @@
"type": "string", "type": "string",
"pattern": "^0x[0-9A-F]{4}$" "pattern": "^0x[0-9A-F]{4}$"
}, },
"bcd_version": { "json_file_path": {
"type": "string", "type": "string",
"pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$" "pattern": "^[0-9a-z_/\\-]+\\.json$"
}, },
"text_identifier": { "key_unit": {
"type": "string", "type": "number"
"minLength": 1,
"maxLength": 250
}, },
"snake_case": { "keyboard": {
"type": "string", "type": "string",
"pattern": "^[a-z][a-z0-9_]*$" "pattern": "^[0-9a-z][0-9a-z_/]*$"
},
"keyboard_keymap_tuple": {
"type": "array",
"prefixItems": [
{"$ref": "#/keyboard"},
{"$ref": "#/filename"}
],
"unevaluatedItems": false
},
"keycode": {
"type": "string",
"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]*$"
}, },
"layout_macro": { "layout_macro": {
"oneOf": [ "oneOf": [
@ -68,49 +121,6 @@
} }
] ]
}, },
"key_unit": {
"type": "number"
},
"keyboard": {
"type": "string",
"pattern": "^[0-9a-z][0-9a-z_/]*$"
},
"keycode": {
"type": "string",
"minLength": 2,
"maxLength": 50,
"pattern": "^[A-Z][A-Zs_0-9]*$"
},
"keycode_short": {
"type": "string",
"minLength": 2,
"maxLength": 7,
"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"}
},
"mcu_pin_array": {
"type": "array",
"items": {"$ref": "#/mcu_pin"}
},
"mcu_pin": { "mcu_pin": {
"oneOf": [ "oneOf": [
{ {
@ -129,14 +139,14 @@
"type": "string", "type": "string",
"pattern": "^GP\\d{1,2}$" "pattern": "^GP\\d{1,2}$"
}, },
{ {"type": "integer"},
"type": "integer" {"type": "null"}
},
{
"type": "null"
}
] ]
}, },
"mcu_pin_array": {
"type": "array",
"items": {"$ref": "#/mcu_pin"}
},
"signed_decimal": { "signed_decimal": {
"type": "number" "type": "number"
}, },
@ -148,17 +158,22 @@
"minimum": -127, "minimum": -127,
"maximum": 127 "maximum": 127
}, },
"snake_case": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$"
},
"string_array": { "string_array": {
"type": "array", "type": "array",
"items": { "items": {"type": "string"}
"type": "string"
}
}, },
"string_object": { "string_object": {
"type": "object", "type": "object",
"additionalProperties": { "additionalProperties": {"type": "string"}
"type": "string" },
} "text_identifier": {
"type": "string",
"minLength": 1,
"maxLength": 250
}, },
"unsigned_decimal": { "unsigned_decimal": {
"type": "number", "type": "number",
@ -172,28 +187,5 @@
"type": "integer", "type": "integer",
"minimum": 0, "minimum": 0,
"maximum": 255 "maximum": 255
},
"bit": {
"type": "integer",
"minimum": 0,
"maximum": 1
},
"keyboard_keymap_tuple": {
"type": "array",
"prefixItems": [
{ "$ref": "#/keyboard" },
{ "$ref": "#/filename" }
],
"unevaluatedItems": false
},
"json_file_path": {
"type": "string",
"pattern": "^[0-9a-z_/\\-]+\\.json$"
},
"build_target": {
"oneOf": [
{ "$ref": "#/keyboard_keymap_tuple" },
{ "$ref": "#/json_file_path" }
]
} }
} }