definitions.jsonschema 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. {
  2. "$schema": "http://json-schema.org/draft-07/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_ANSI_DEFAULT",
  45. "LAYOUT_JP",
  46. "LAYOUT_ortho_3x12_1x2uC",
  47. "LAYOUT_ortho_4x12_1x2uC",
  48. "LAYOUT_ortho_4x12_1x2uL",
  49. "LAYOUT_ortho_4x12_1x2uR",
  50. "LAYOUT_ortho_5x12_1x2uC",
  51. "LAYOUT_ortho_5x12_2x2uC",
  52. "LAYOUT_ortho_5x14_1x2uC",
  53. "LAYOUT_ortho_5x14_1x2uL",
  54. "LAYOUT_ortho_5x14_1x2uR",
  55. "LAYOUT_planck_1x2uC",
  56. "LAYOUT_planck_1x2uL",
  57. "LAYOUT_planck_1x2uR",
  58. "LAYOUT_preonic_1x2uC",
  59. "LAYOUT_preonic_1x2uL",
  60. "LAYOUT_preonic_1x2uR",
  61. "LAYOUT_reviung34_2uL"
  62. ]
  63. },
  64. {
  65. "type": "string",
  66. "pattern": "^LAYOUT_[0-9a-z_]*$"
  67. }
  68. ]
  69. },
  70. "key_unit": {
  71. "type": "number",
  72. "min": 0.25
  73. },
  74. "keyboard": {
  75. "oneOf": [
  76. {
  77. "type": "string",
  78. "enum": [
  79. "converter/numeric_keypad_IIe",
  80. "emptystring/NQG",
  81. "maple_computing/christmas_tree/V2017"
  82. ]
  83. },
  84. {
  85. "type": "string",
  86. "pattern": "^[0-9a-z][0-9a-z_/]*$"
  87. }
  88. ]
  89. },
  90. "mcu_pin_array": {
  91. "type": "array",
  92. "items": {"$ref": "#/mcu_pin"}
  93. },
  94. "mcu_pin": {
  95. "oneOf": [
  96. {
  97. "type": "string",
  98. "enum": ["NO_PIN"]
  99. },
  100. {
  101. "type": "string",
  102. "pattern": "^[A-K]\\d{1,2}$"
  103. },
  104. {
  105. "type": "string",
  106. "pattern": "^LINE_PIN\\d{1,2}$"
  107. },
  108. {
  109. "type": "number",
  110. "multipleOf": 1
  111. },
  112. {
  113. "type": "null"
  114. }
  115. ]
  116. },
  117. "signed_decimal": {
  118. "type": "number"
  119. },
  120. "signed_int": {
  121. "type": "number",
  122. "multipleOf": 1
  123. },
  124. "signed_int_8": {
  125. "type": "number",
  126. "min": -127,
  127. "max": 127,
  128. "multipleOf": 1
  129. },
  130. "string_array": {
  131. "type": "array",
  132. "items": {
  133. "type": "string"
  134. }
  135. },
  136. "string_object": {
  137. "type": "object",
  138. "additionalProperties": {
  139. "type": "string"
  140. }
  141. },
  142. "unsigned_decimal": {
  143. "type": "number",
  144. "min": 0
  145. },
  146. "unsigned_int": {
  147. "type": "number",
  148. "min": 0,
  149. "multipleOf": 1
  150. },
  151. "unsigned_int_8": {
  152. "type": "number",
  153. "min": 0,
  154. "max": 255,
  155. "multipleOf": 1
  156. }
  157. }