{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apigenie.pl/schemas/apigenie-catalog-versions-report.json",
  "title": "apigenie-catalog versions --json",
  "description": "The releases of one specification of the catalog, as `apigenie-catalog versions NAME --json` writes them (ADR-206): the git tags matching the catalog's tag pattern for the name, newest first. Adding members keeps formatVersion; removing a member or changing its meaning or type increments it.",
  "type": "object",
  "required": ["formatVersion", "root", "config", "name", "path", "tagPattern", "version", "unreleased", "releases"],
  "properties": {
    "formatVersion": {
      "description": "The version of this format.",
      "const": 1
    },
    "root": {
      "description": "The absolute path of the root of the catalog, which `path` is relative to.",
      "type": "string"
    },
    "config": {
      "description": "The absolute path of the configuration file whose catalog section was applied, or null.",
      "type": ["string", "null"]
    },
    "name": {
      "description": "The name of the specification in the catalog.",
      "type": "string"
    },
    "path": {
      "description": "The specification file, relative to the root, with `/` separators.",
      "type": "string"
    },
    "tagPattern": {
      "description": "The pattern of the release tags (`catalog.tags.pattern`), with `{name}` and `{version}` placeholders.",
      "type": "string"
    },
    "version": {
      "description": "info.version of the file at HEAD; null when the document has none.",
      "type": ["string", "null"]
    },
    "unreleased": {
      "description": "Whether the file has an info.version that no release holds.",
      "type": "boolean"
    },
    "releases": {
      "description": "The releases, newest version first.",
      "type": "array",
      "items": { "$ref": "#/$defs/release" }
    }
  },
  "$defs": {
    "release": {
      "type": "object",
      "required": ["version", "tag", "commit"],
      "properties": {
        "version": {
          "description": "The semantic version the tag holds where `{version}` stands in the pattern.",
          "type": "string"
        },
        "tag": {
          "description": "The name of the tag.",
          "type": "string"
        },
        "commit": {
          "description": "The commit the tag points at (the commit of an annotated tag, not the tag object).",
          "type": "object",
          "required": ["id", "shortId", "author", "date", "subject"],
          "properties": {
            "id": { "type": "string" },
            "shortId": { "type": "string" },
            "author": { "type": "string" },
            "date": { "description": "ISO 8601, with the author's time zone.", "type": "string", "format": "date-time" },
            "subject": { "type": "string" }
          }
        }
      }
    }
  }
}
