You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

191 lines
4.8 KiB

  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema#",
  3. "$id": "qmk.definitions.v1",
  4. "title": "Common definitions used across QMK's jsonschemas.",
  5. "type": "object",
  6. "bcd_version": {
  7. "type": "string",
  8. "pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$"
  9. },
  10. "bit": {
  11. "type": "integer",
  12. "minimum": 0,
  13. "maximum": 1
  14. },
  15. "boolean_array": {
  16. "type": "object",
  17. "additionalProperties": {"type": "boolean"}
  18. },
  19. "build_target": {
  20. "oneOf": [
  21. {"$ref": "#/keyboard_keymap_tuple"},
  22. {"$ref": "#/json_file_path"}
  23. ]
  24. },
  25. "filename": {
  26. "type": "string",
  27. "minLength": 1,
  28. "pattern": "^[0-9a-z_]*$"
  29. },
  30. "hex_number_2d": {
  31. "type": "string",
  32. "pattern": "^0x[0-9A-F]{2}$"
  33. },
  34. "hex_number_4d": {
  35. "type": "string",
  36. "pattern": "^0x[0-9A-F]{4}$"
  37. },
  38. "json_file_path": {
  39. "type": "string",
  40. "pattern": "^[0-9a-z_/\\-]+\\.json$"
  41. },
  42. "key_unit": {
  43. "type": "number"
  44. },
  45. "keyboard": {
  46. "type": "string",
  47. "pattern": "^[0-9a-z][0-9a-z_/]*$"
  48. },
  49. "keyboard_keymap_tuple": {
  50. "type": "array",
  51. "prefixItems": [
  52. {"$ref": "#/keyboard"},
  53. {"$ref": "#/filename"}
  54. ],
  55. "unevaluatedItems": false
  56. },
  57. "keycode": {
  58. "type": "string",
  59. "minLength": 2,
  60. "maxLength": 50,
  61. "pattern": "^[A-Z][A-Zs_0-9]*$"
  62. },
  63. "keycode_decl": {
  64. "type": "object",
  65. "required": [
  66. "key"
  67. ],
  68. "properties": {
  69. "key": {"$ref": "#/keycode"},
  70. "label": {"$ref": "#/text_identifier"},
  71. "aliases": {
  72. "type": "array",
  73. "minItems": 1,
  74. "items": {"$ref": "#/keycode_short"}
  75. }
  76. }
  77. },
  78. "keycode_decl_array": {
  79. "type": "array",
  80. "minItems": 1,
  81. "items": {"$ref": "#/keycode_decl"}
  82. },
  83. "keycode_short": {
  84. "type": "string",
  85. "minLength": 2,
  86. "maxLength": 7,
  87. "pattern": "^[A-Z][A-Zs_0-9]*$"
  88. },
  89. "layout_macro": {
  90. "oneOf": [
  91. {
  92. "type": "string",
  93. "enum": [
  94. "LAYOUT",
  95. "LAYOUT_1x2uC",
  96. "LAYOUT_1x2uL",
  97. "LAYOUT_1x2uR",
  98. "LAYOUT_2x2uC",
  99. "LAYOUT_2x3uC",
  100. "LAYOUT_625uC",
  101. "LAYOUT_ortho_3x12_1x2uC",
  102. "LAYOUT_ortho_4x12_1x2uC",
  103. "LAYOUT_ortho_4x12_1x2uL",
  104. "LAYOUT_ortho_4x12_1x2uR",
  105. "LAYOUT_ortho_5x12_1x2uC",
  106. "LAYOUT_ortho_5x12_2x2uC",
  107. "LAYOUT_ortho_5x14_1x2uC",
  108. "LAYOUT_ortho_5x14_1x2uL",
  109. "LAYOUT_ortho_5x14_1x2uR",
  110. "LAYOUT_planck_1x2uC",
  111. "LAYOUT_planck_1x2uL",
  112. "LAYOUT_planck_1x2uR",
  113. "LAYOUT_preonic_1x2uC",
  114. "LAYOUT_preonic_1x2uL",
  115. "LAYOUT_preonic_1x2uR"
  116. ]
  117. },
  118. {
  119. "type": "string",
  120. "pattern": "^LAYOUT_[0-9a-z_]*$"
  121. }
  122. ]
  123. },
  124. "mcu_pin": {
  125. "oneOf": [
  126. {
  127. "type": "string",
  128. "enum": ["NO_PIN"]
  129. },
  130. {
  131. "type": "string",
  132. "pattern": "^[A-K]\\d{1,2}$"
  133. },
  134. {
  135. "type": "string",
  136. "pattern": "^LINE_PIN\\d{1,2}$"
  137. },
  138. {
  139. "type": "string",
  140. "pattern": "^GP\\d{1,2}$"
  141. },
  142. {"type": "integer"},
  143. {"type": "null"}
  144. ]
  145. },
  146. "mcu_pin_array": {
  147. "type": "array",
  148. "items": {"$ref": "#/mcu_pin"}
  149. },
  150. "signed_decimal": {
  151. "type": "number"
  152. },
  153. "signed_int": {
  154. "type": "integer"
  155. },
  156. "signed_int_8": {
  157. "type": "integer",
  158. "minimum": -127,
  159. "maximum": 127
  160. },
  161. "snake_case": {
  162. "type": "string",
  163. "pattern": "^[a-z][a-z0-9_]*$"
  164. },
  165. "string_array": {
  166. "type": "array",
  167. "items": {"type": "string"}
  168. },
  169. "string_object": {
  170. "type": "object",
  171. "additionalProperties": {"type": "string"}
  172. },
  173. "text_identifier": {
  174. "type": "string",
  175. "minLength": 1,
  176. "maxLength": 250
  177. },
  178. "unsigned_decimal": {
  179. "type": "number",
  180. "minimum": 0
  181. },
  182. "unsigned_int": {
  183. "type": "integer",
  184. "minimum": 0
  185. },
  186. "unsigned_int_8": {
  187. "type": "integer",
  188. "minimum": 0,
  189. "maximum": 255
  190. }
  191. }