board_viewer_annotations.schema.json 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. {
  2. "$schema": "https://json-schema.org/draft/2020-12/schema",
  3. "$id": "https://local.invalid/schemas/board_viewer_annotations.schema.json",
  4. "title": "Board viewer curated annotations",
  5. "type": "object",
  6. "additionalProperties": false,
  7. "required": ["schema", "board_id", "connector_profiles", "touchpoints", "interfaces", "photo_overlay"],
  8. "properties": {
  9. "schema": {"const": "board-viewer-annotations-v1"},
  10. "board_id": {"type": "string", "minLength": 1},
  11. "connector_profiles": {
  12. "type": "object",
  13. "additionalProperties": {"$ref": "#/$defs/connectorProfile"}
  14. },
  15. "annotation_templates": {
  16. "type": "object",
  17. "additionalProperties": {"$ref": "#/$defs/touchpointAnnotation"}
  18. },
  19. "template_instances": {
  20. "type": "object",
  21. "additionalProperties": {"$ref": "#/$defs/templateInstance"}
  22. },
  23. "touchpoints": {
  24. "type": "object",
  25. "additionalProperties": {"$ref": "#/$defs/touchpointAnnotation"}
  26. },
  27. "interfaces": {
  28. "type": "array",
  29. "items": {"$ref": "#/$defs/interface"}
  30. },
  31. "photo_overlay": {
  32. "oneOf": [
  33. {"type": "null"},
  34. {"$ref": "#/$defs/photoOverlay"}
  35. ]
  36. }
  37. },
  38. "$defs": {
  39. "evidenceTier": {
  40. "enum": ["board_database", "cross_verified", "name_inferred", "unknown"]
  41. },
  42. "touchpointAnnotation": {
  43. "type": "object",
  44. "additionalProperties": false,
  45. "required": ["summary", "pins"],
  46. "properties": {
  47. "summary": {"type": "string", "minLength": 1},
  48. "pins": {
  49. "type": "object",
  50. "additionalProperties": {"$ref": "#/$defs/pinAnnotation"}
  51. }
  52. }
  53. },
  54. "templateInstance": {
  55. "type": "object",
  56. "additionalProperties": false,
  57. "required": ["template", "variables"],
  58. "properties": {
  59. "template": {"type": "string", "minLength": 1},
  60. "variables": {
  61. "type": "object",
  62. "additionalProperties": {"type": "string"}
  63. }
  64. }
  65. },
  66. "connectorProfile": {
  67. "type": "object",
  68. "additionalProperties": false,
  69. "required": ["references", "contact_pins", "shield_pads", "evidence_tier", "sources"],
  70. "properties": {
  71. "component_value": {"type": "string"},
  72. "references": {
  73. "type": "array",
  74. "minItems": 1,
  75. "uniqueItems": true,
  76. "items": {"type": "string", "pattern": "^(CON|J|PL)[0-9]+$"}
  77. },
  78. "contact_pins": {
  79. "type": "array",
  80. "minItems": 1,
  81. "uniqueItems": true,
  82. "items": {"type": "string", "minLength": 1}
  83. },
  84. "shield_pads": {
  85. "type": "array",
  86. "uniqueItems": true,
  87. "items": {"type": "string", "minLength": 1}
  88. },
  89. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  90. "sources": {
  91. "type": "array",
  92. "minItems": 1,
  93. "items": {"type": "string", "minLength": 1}
  94. }
  95. }
  96. },
  97. "pinAnnotation": {
  98. "type": "object",
  99. "additionalProperties": false,
  100. "required": ["summary", "path", "evidence_tier", "sources"],
  101. "properties": {
  102. "summary": {"type": "string", "minLength": 1},
  103. "path": {"type": "array", "items": {"type": "string", "minLength": 1}},
  104. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  105. "sources": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
  106. "direction": {"enum": ["input", "output", "bidirectional", "passive", "unknown"]},
  107. "external_level": {"type": "string", "minLength": 1},
  108. "function_category": {"type": "string", "minLength": 1},
  109. "reserved": {"type": "boolean"},
  110. "fixed_load_conflict": {"type": "boolean"},
  111. "board_pull": {"type": ["string", "null"]},
  112. "adc_pulltype": {"type": ["string", "null"], "pattern": "^[A-Z][A-Z0-9_]*$"},
  113. "active_level": {"type": "string", "minLength": 1},
  114. "polarity": {"type": "string", "minLength": 1},
  115. "external_components": {
  116. "type": "array",
  117. "items": {"type": "string", "minLength": 1}
  118. },
  119. "fpga": {"$ref": "#/$defs/fpgaAnnotation"},
  120. "mcu": {"$ref": "#/$defs/mcuAnnotation"},
  121. "programming": {"$ref": "#/$defs/programmingAnnotation"}
  122. }
  123. },
  124. "fpgaAnnotation": {
  125. "type": "object",
  126. "additionalProperties": false,
  127. "required": ["ball", "board_signal", "io_standard", "capabilities", "evidence_tier", "sources"],
  128. "properties": {
  129. "ball": {"type": "string", "minLength": 1},
  130. "board_signal": {"type": "string", "minLength": 1},
  131. "io_standard": {"type": "string", "minLength": 1},
  132. "capabilities": {
  133. "type": "array",
  134. "minItems": 1,
  135. "items": {"type": "string", "minLength": 1}
  136. },
  137. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  138. "sources": {
  139. "type": "array",
  140. "minItems": 1,
  141. "items": {"type": "string", "minLength": 1}
  142. }
  143. }
  144. },
  145. "mcuAnnotation": {
  146. "type": "object",
  147. "additionalProperties": false,
  148. "required": ["device", "family", "pin", "signal", "capabilities", "evidence_tier", "sources"],
  149. "properties": {
  150. "device": {"type": "string", "minLength": 1},
  151. "family": {"type": "string", "minLength": 1},
  152. "pin": {"type": "string", "minLength": 1},
  153. "signal": {"type": "string", "minLength": 1},
  154. "capabilities": {
  155. "type": "array",
  156. "minItems": 1,
  157. "items": {"type": "string", "minLength": 1}
  158. },
  159. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  160. "sources": {
  161. "type": "array",
  162. "minItems": 1,
  163. "items": {"type": "string", "minLength": 1}
  164. }
  165. }
  166. },
  167. "programmingAnnotation": {
  168. "type": "object",
  169. "additionalProperties": false,
  170. "required": ["evidence_tier", "sources"],
  171. "properties": {
  172. "status": {"enum": ["verified_fpga", "verified_mcu", "board_only", "not_programmable", "unknown"]},
  173. "conclusion": {"type": "string", "minLength": 1},
  174. "network_explanation": {"type": "string", "minLength": 1},
  175. "hdl_guidance": {"type": "string", "minLength": 1},
  176. "connection_guidance": {
  177. "type": "array",
  178. "minItems": 1,
  179. "items": {"type": "string", "minLength": 1}
  180. },
  181. "constraints": {"type": "array", "items": {"type": "string", "minLength": 1}},
  182. "risks": {"type": "array", "items": {"type": "string", "minLength": 1}},
  183. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  184. "sources": {
  185. "type": "array",
  186. "minItems": 1,
  187. "items": {"type": "string", "minLength": 1}
  188. }
  189. }
  190. },
  191. "interface": {
  192. "type": "object",
  193. "additionalProperties": false,
  194. "required": ["id", "name", "touchpoint", "pins", "external_level", "evidence_tier", "sources"],
  195. "properties": {
  196. "id": {"type": "string", "pattern": "^[a-z0-9-]+$"},
  197. "name": {"type": "string", "minLength": 1},
  198. "touchpoint": {"type": "string", "pattern": "^(CON|J|PL|TP)[0-9]+$"},
  199. "pins": {"type": "array", "minItems": 1, "items": {"type": "string"}},
  200. "external_level": {"type": "string", "minLength": 1},
  201. "evidence_tier": {"$ref": "#/$defs/evidenceTier"},
  202. "sources": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}
  203. }
  204. },
  205. "photoOverlay": {
  206. "type": "object",
  207. "additionalProperties": false,
  208. "required": ["path", "sha256", "control_points"],
  209. "properties": {
  210. "path": {"type": "string", "minLength": 1},
  211. "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
  212. "control_points": {
  213. "type": "array",
  214. "minItems": 3,
  215. "items": {
  216. "type": "object",
  217. "additionalProperties": false,
  218. "required": ["image", "board"],
  219. "properties": {
  220. "image": {"$ref": "#/$defs/point"},
  221. "board": {"$ref": "#/$defs/point"}
  222. }
  223. }
  224. }
  225. }
  226. },
  227. "point": {
  228. "type": "object",
  229. "additionalProperties": false,
  230. "required": ["x", "y"],
  231. "properties": {
  232. "x": {"type": "number"},
  233. "y": {"type": "number"}
  234. }
  235. }
  236. }
  237. }