definitions.jsonschema 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. "oneOf": [
  72. {
  73. "type": "string",
  74. "enum": [
  75. "converter/numeric_keypad_IIe",
  76. "emptystring/NQG",
  77. "maple_computing/christmas_tree/V2017"
  78. ]
  79. },
  80. {
  81. "type": "string",
  82. "pattern": "^[0-9a-z][0-9a-z_/]*$"
  83. }
  84. ]
  85. },
  86. "mcu_pin_array": {
  87. "type": "array",
  88. "items": {"$ref": "#/mcu_pin"}
  89. },
  90. "mcu_pin": {
  91. "oneOf": [
  92. {
  93. "type": "string",
  94. "enum": ["NO_PIN"]
  95. },
  96. {
  97. "type": "string",
  98. "pattern": "^[A-K]\\d{1,2}$"
  99. },
  100. {
  101. "type": "string",
  102. "pattern": "^LINE_PIN\\d{1,2}$"
  103. },
  104. {
  105. "type": "string",
  106. "pattern": "^GP\\d{1,2}$"
  107. },
  108. {
  109. "type": "integer"
  110. },
  111. {
  112. "type": "null"
  113. }
  114. ]
  115. },
  116. "signed_decimal": {
  117. "type": "number"
  118. },
  119. "signed_int": {
  120. "type": "integer"
  121. },
  122. "signed_int_8": {
  123. "type": "integer",
  124. "minimum": -127,
  125. "maximum": 127
  126. },
  127. "string_array": {
  128. "type": "array",
  129. "items": {
  130. "type": "string"
  131. }
  132. },
  133. "string_object": {
  134. "type": "object",
  135. "additionalProperties": {
  136. "type": "string"
  137. }
  138. },
  139. "unsigned_decimal": {
  140. "type": "number",
  141. "minimum": 0
  142. },
  143. "unsigned_int": {
  144. "type": "integer",
  145. "minimum": 0
  146. },
  147. "unsigned_int_8": {
  148. "type": "integer",
  149. "minimum": 0,
  150. "maximum": 255
  151. },
  152. "bit": {
  153. "type": "integer",
  154. "minimum": 0,
  155. "maximum": 1
  156. }
  157. }