definitions.jsonschema 4.1 KB

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