qmk_firmware/data/schemas/xap.jsonschema

262 lines
8.0 KiB
Plaintext
Raw Normal View History

2022-05-23 19:02:14 +00:00
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "qmk.xap.v1",
"title": "XAP Spec",
"definitions": {
"data_type": {
"oneOf": [
{
"enum": [
"bool",
"u8",
"u16",
"u32",
"u64",
"struct",
"string"
]
},
{
"type": "string",
"pattern": "^u\\d{1,2}\\[\\d{1,2}\\]*$"
}
]
},
"router_type": {
"enum": [
"command",
"router"
]
},
"permission": {
"enum": [
"secure",
"ignore"
]
},
"struct": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
2022-05-24 00:19:16 +00:00
"required": [
"name",
"type"
],
2022-05-23 19:02:14 +00:00
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
},
"route": {
"type": "object",
"propertyNames": {
"$ref": "qmk.definitions.v1#/hex_number_2d"
},
"additionalProperties": {
"type": "object",
2022-05-24 00:19:16 +00:00
"required": [
"type",
"define"
],
2022-05-23 19:02:14 +00:00
"additionalProperties": false,
"properties": {
"type": {
"$ref": "#/definitions/router_type"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"define": {
2022-05-24 00:19:16 +00:00
"$ref": "qmk.definitions.v1#/define"
2022-05-23 19:02:14 +00:00
},
"permissions": {
"$ref": "#/definitions/permission"
},
"enable_if_preprocessor": {
"type": "string"
},
"request_type": {
"$ref": "#/definitions/data_type"
},
"request_struct_length": {
"type": "number"
},
"request_purpose": {
"type": "string"
},
"return_type": {
"$ref": "#/definitions/data_type"
},
"request_struct_members": {
"$ref": "#definitions/struct"
},
"return_struct_length": {
"type": "number"
},
"return_constant": {
"type": [
"array",
"string"
]
},
"return_struct_members": {
"$ref": "#definitions/struct"
},
"return_purpose": {
"type": "string"
},
"return_execute": {
"type": "string"
},
"routes": {
"$ref": "#/definitions/route"
}
}
}
}
},
"type": "object",
"additionalProperties": false,
"required": [
"version"
],
"properties": {
"version": {
"$ref": "qmk.definitions.v1#/bcd_version"
},
"define": {
2022-05-24 00:19:16 +00:00
"$ref": "qmk.definitions.v1#/define"
2022-05-23 19:02:14 +00:00
},
"uses": {
"type": "object",
"additionalProperties": {
"$ref": "qmk.definitions.v1#/bcd_version"
}
},
"documentation": {
"type": "object",
"properties": {
"order": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": {
"type": "string"
}
},
"term_definitions": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"type_docs": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"type_definitions": {
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"$ref": "#/definitions/data_type"
},
"struct_length": {
"type": "number"
},
"struct_members": {
"$ref": "#definitions/struct"
}
}
}
},
"response_flags": {
"type": "object",
"additionalProperties": false,
"properties": {
"define_prefix": {
2022-05-24 00:19:16 +00:00
"$ref": "qmk.definitions.v1#/define"
2022-05-23 19:02:14 +00:00
},
"bits": {
"type": "object",
"propertyNames": {
2022-05-24 00:19:16 +00:00
"$ref": "qmk.definitions.v1#/text_unsigned_int"
2022-05-23 19:02:14 +00:00
},
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"define": {
2022-05-24 00:19:16 +00:00
"$ref": "qmk.definitions.v1#/define"
2022-05-23 19:02:14 +00:00
},
"description": {
"type": "string"
}
}
}
}
}
},
"broadcast_messages": {
"type": "object",
"additionalProperties": false,
"properties": {
"define_prefix": {
2022-05-24 00:19:16 +00:00
"$ref": "qmk.definitions.v1#/define"
2022-05-23 19:02:14 +00:00
},
"messages": {
"type": "object",
"propertyNames": {
"$ref": "qmk.definitions.v1#/hex_number_2d"
},
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"define": {
2022-05-24 00:19:16 +00:00
"$ref": "qmk.definitions.v1#/define"
2022-05-23 19:02:14 +00:00
},
"description": {
"type": "string"
},
"return_type": {
"$ref": "#/definitions/data_type"
}
}
}
}
}
},
"routes": {
"$ref": "#/definitions/route"
}
}
}