firmwares.schema.json 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {
  2. "description": "Schema file for uFBT-FirmwareManager firmwares.json file",
  3. "$schema": "https://json-schema.org/draft/2020-12/schema",
  4. "type": "object",
  5. "properties": {
  6. "firmwares": {
  7. "description": "Available firmwares",
  8. "type": "array",
  9. "items": {
  10. "type": "object",
  11. "allOf": [
  12. {
  13. "properties": {
  14. "alias": {
  15. "description": "Firmware alias(-es)",
  16. "type": "array",
  17. "items": {
  18. "type": "string"
  19. },
  20. "minItems": 1,
  21. "uniqueItems": true
  22. },
  23. "description": {
  24. "description": "User-friendly description explaining firmware details",
  25. "type": "string"
  26. },
  27. "type": {
  28. "description": "Type of firmware reference. `index` - firmware from index; `git-release` - firmware from gir releases",
  29. "enum": [
  30. "index",
  31. "git-release"
  32. ]
  33. }
  34. },
  35. "required": [
  36. "alias",
  37. "description"
  38. ],
  39. "unevaluatedProperties ": false
  40. },
  41. {
  42. "oneOf": [
  43. {
  44. "if": {
  45. "properties": {
  46. "type": {
  47. "const": "index"
  48. }
  49. },
  50. "required": [
  51. "type"
  52. ]
  53. },
  54. "then": {
  55. "properties": {
  56. "index_url": {
  57. "description": "Index URL to look for firmware",
  58. "type": "string"
  59. },
  60. "channel": {
  61. "description": "Index channel to pull firmware from",
  62. "type": "string"
  63. }
  64. },
  65. "required": [
  66. "index_url",
  67. "channel"
  68. ],
  69. "unevaluatedProperties ": false
  70. },
  71. "else": false
  72. },
  73. {
  74. "if": {
  75. "properties": {
  76. "type": {
  77. "const": "git-release"
  78. }
  79. },
  80. "required": [
  81. "type"
  82. ]
  83. },
  84. "then": {
  85. "properties": {
  86. "git_repo": {
  87. "description": "Firmware Github repo in format `author/repo_name`",
  88. "type": "string"
  89. },
  90. "git_release": {
  91. "description": "Github release name to pull firmware from",
  92. "type": "string"
  93. }
  94. },
  95. "required": [
  96. "git_repo",
  97. "git_release"
  98. ],
  99. "unevaluatedProperties ": false
  100. },
  101. "else": false
  102. }
  103. ]
  104. }
  105. ]
  106. }
  107. }
  108. },
  109. "required": [
  110. "firmwares"
  111. ],
  112. "unevaluatedProperties ": false
  113. }