summaryrefslogtreecommitdiffstats
path: root/data/schemas/definitions.jsonschema
blob: 3f92e289a79c609be738da64731cf8741e03c582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "qmk.definitions.v1",
    "title": "Common definitions used across QMK's jsonschemas.",
    "type": "object",
    "boolean_array": {
        "type": "object",
        "additionalProperties": {"type": "boolean"}
    },
    "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}$"
    },
    "bcd_version": {
        "type": "string",
        "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$"
    },
    "text_identifier": {
        "type": "string",
        "minLength": 1,
        "maxLength": 250
    },
    "layout_macro": {
        "oneOf": [
            {
                "type": "string",
                "enum": ["LAYOUT", "LAYOUT_planck_1x2uC"]
            },
            {
                "type": "string",
                "pattern": "^LAYOUT_[0-9a-z_]*$"
            }
        ]
    },
    "key_unit": {
        "type": "number",
        "min": 0.25
    },
    "mcu_pin_array": {
        "type": "array",
        "items": {"$ref": "#/mcu_pin"}
    },
    "mcu_pin": {
        "oneOf": [
            {
                "type": "string",
                "pattern": "^[A-K]\\d{1,2}$"
            },
            {
                "type": "string",
                "pattern": "^LINE_PIN\\d{1,2}$"
            },
            {
                "type": "number",
                "multipleOf": 1
            },
            {
                "type": "null"
            }
        ]
    },
    "signed_decimal": {
        "type": "number"
    },
    "signed_int": {
        "type": "number",
        "multipleOf": 1
    },
    "signed_int_8": {
        "type": "number",
        "min": -127,
        "max": 127,
        "multipleOf": 1
    },
    "string_array": {
        "type": "array",
        "items": {
            "type": "string"
        }
    },
    "string_object": {
        "type": "object",
        "additionalProperties": {
            "type": "string"
        }
    },
    "unsigned_decimal": {
        "type": "number",
        "min": 0
    },
    "unsigned_int": {
        "type": "number",
        "min": 0,
        "multipleOf": 1
    },
    "unsigned_int_8": {
        "type": "number",
        "min": 0,
        "max": 255,
        "multipleOf": 1
    }
}