{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://driftsys.github.io/schemas/markspec/bom/v1.json",
  "title": "MarkSpec BOM Index",
  "description": "BOM index listing component summaries for tree assembly.",
  "type": "object",
  "required": ["project", "version", "totalComponents", "components"],
  "additionalProperties": false,
  "properties": {
    "project": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "totalComponents": {
      "type": "integer",
      "minimum": 0
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["displayId", "title", "nodeType", "url"],
        "additionalProperties": false,
        "properties": {
          "displayId": { "type": "string" },
          "title": { "type": "string" },
          "nodeType": {
            "type": "string",
            "enum": ["component", "part", "module", "service", "device"]
          },
          "partOf": {
            "type": ["string", "null"]
          },
          "url": { "type": "string" }
        }
      }
    }
  }
}
