definitions.jsonschema 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. "keycode": {
  16. "type": "string",
  17. "minLength": 1,
  18. "maxLength": 250,
  19. "pattern": "^[A-Z_][0-9A-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. "text_identifier": {
  30. "type": "string",
  31. "minLength": 1,
  32. "maxLength": 250
  33. },
  34. "layout_macro": {
  35. "oneOf": [
  36. {
  37. "type": "string",
  38. "enum": ["LAYOUT", "LAYOUT_planck_1x2uC"]
  39. },
  40. {
  41. "type": "string",
  42. "pattern": "^LAYOUT_[0-9a-z_]*$"
  43. }
  44. ]
  45. },
  46. "key_unit": {
  47. "type": "number",
  48. "min": 0.25
  49. },
  50. "mcu_pin_array": {
  51. "type": "array",
  52. "items": {"$ref": "#/mcu_pin"}
  53. },
  54. "mcu_pin": {
  55. "oneOf": [
  56. {
  57. "type": "string",
  58. "pattern": "^[A-K]\\d{1,2}$"
  59. },
  60. {
  61. "type": "string",
  62. "pattern": "^LINE_PIN\\d{1,2}$"
  63. },
  64. {
  65. "type": "number",
  66. "multipleOf": 1
  67. },
  68. {
  69. "type": "null"
  70. }
  71. ]
  72. },
  73. "signed_decimal": {
  74. "type": "number"
  75. },
  76. "signed_int": {
  77. "type": "number",
  78. "multipleOf": 1
  79. }
  80. "signed_int_8": {
  81. "type": "number",
  82. "min": -127,
  83. "max": 127,
  84. "multipleOf": 1
  85. }
  86. "string_array": {
  87. "type": "array",
  88. "items": {
  89. "type": "string"
  90. }
  91. },
  92. "string_object": {
  93. "type": "object",
  94. "additionalProperties": {
  95. "type": "string"
  96. }
  97. },
  98. "unsigned_decimal": {
  99. "type": "number",
  100. "min": 0
  101. },
  102. "unsigned_int": {
  103. "type": "number",
  104. "min": 0,
  105. "multipleOf": 1
  106. }
  107. "unsigned_int_8": {
  108. "type": "number",
  109. "min": 0,
  110. "max": 255,
  111. "multipleOf": 1
  112. }
  113. }