definitions.jsonschema 3.6 KB

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