{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "release.schema.json",
  "title": "SCO release notes",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "id",
    "version",
    "status",
    "date",
    "notes",
    "upgradePaths",
    "components",
    "breakingChanges",
    "interfaceChanges",
    "features",
    "fixes",
    "knownIssues"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "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"
    },
    "upgradePaths": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "from",
          "supported"
        ],
        "properties": {
          "from": {
            "type": [
              "string",
              "null"
            ]
          },
          "supported": {
            "type": "boolean"
          },
          "notes": {
            "type": "string"
          }
        }
      }
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "type",
          "version",
          "change"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "crossplane-package",
              "helm-chart",
              "container-image",
              "cli"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[0-9A-Za-z.-]+)?$"
          },
          "change": {
            "type": "string",
            "enum": [
              "added",
              "changed",
              "deprecated",
              "removed"
            ]
          },
          "summary": {
            "type": "string"
          }
        }
      }
    },
    "breakingChanges": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "affects",
          "before",
          "after"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "affects": {
            "type": "string"
          },
          "impact": {
            "type": "string"
          },
          "before": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "after": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "docs": {
            "type": "string"
          }
        }
      }
    },
    "interfaceChanges": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "interface",
          "type",
          "change",
          "breaking",
          "summary"
        ],
        "properties": {
          "interface": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "api",
              "configuration",
              "console",
              "rbac",
              "admission"
            ]
          },
          "change": {
            "type": "string",
            "enum": [
              "added",
              "changed",
              "deprecated",
              "removed"
            ]
          },
          "breaking": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          },
          "docs": {
            "type": "string"
          }
        }
      }
    },
    "features": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "summary"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "docs": {
            "type": "string"
          }
        }
      }
    },
    "fixes": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "component",
          "summary"
        ],
        "properties": {
          "component": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        }
      }
    },
    "knownIssues": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "summary",
          "workaround"
        ],
        "properties": {
          "summary": {
            "type": "string"
          },
          "workaround": {
            "type": "string"
          }
        }
      }
    }
  }
}
