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.

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