{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://driftsys.github.io/schemas/markspec/traceability-graph/v1.json",
  "title": "MarkSpec Traceability Graph",
  "description": "Nodes and edges for traceability graph visualization.",
  "type": "object",
  "required": ["nodes", "edges"],
  "additionalProperties": false,
  "properties": {
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "displayId", "title", "kind", "url"],
        "additionalProperties": false,
        "properties": {
          "id": { "type": "string" },
          "displayId": { "type": "string" },
          "title": { "type": "string" },
          "kind": { "type": "string" },
          "entryType": { "type": "string" },
          "url": { "type": "string" }
        }
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["source", "target", "kind"],
        "additionalProperties": false,
        "properties": {
          "source": { "type": "string" },
          "target": { "type": "string" },
          "kind": {
            "type": "string",
            "enum": [
              "satisfies",
              "satisfiedBy",
              "derivedFrom",
              "derivedTo",
              "allocates",
              "allocatedBy",
              "verifies",
              "verifiedBy",
              "implements",
              "implementedBy"
            ]
          }
        }
      }
    }
  }
}
