{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "index.schema.json",
  "title": "SCO release index",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "product",
    "releases"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "product": {
      "type": "string"
    },
    "releases": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "version",
          "status",
          "date",
          "notes",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?$"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "released",
              "withdrawn"
            ]
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
          },
          "notes": {
            "type": "string"
          },
          "data": {
            "type": "string"
          }
        }
      }
    }
  }
}
