{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apigenie.pl/schemas/apigenie-catalog-release-report.json",
  "title": "apigenie-catalog release --json",
  "description": "What `apigenie-catalog release NAME VERSION --json` did or found (ADR-206): the tag it created at HEAD, or the problems that stopped the release. Adding members keeps formatVersion; removing a member or changing its meaning or type increments it.",
  "type": "object",
  "required": ["formatVersion", "root", "config", "name", "version", "tag", "commit", "previous", "created", "pushed", "remote", "problems"],
  "properties": {
    "formatVersion": {
      "description": "The version of this format.",
      "const": 1
    },
    "root": {
      "description": "The absolute path of the root of the catalog.",
      "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"
    },
    "version": {
      "description": "The version asked for.",
      "type": "string"
    },
    "tag": {
      "description": "The tag of the release: `catalog.tags.pattern` with the name and the version filled in.",
      "type": "string"
    },
    "commit": {
      "description": "HEAD, where the tag is or would be created.",
      "$ref": "#/$defs/commit"
    },
    "previous": {
      "description": "The latest release below this version, or null when there is none.",
      "oneOf": [
        { "type": "null" },
        {
          "type": "object",
          "required": ["version", "tag", "commit"],
          "properties": {
            "version": { "type": "string" },
            "tag": { "type": "string" },
            "commit": { "$ref": "#/$defs/commit" }
          }
        }
      ]
    },
    "created": {
      "description": "Whether the tag was created: false with --dry-run and when problems stopped the release.",
      "type": "boolean"
    },
    "pushed": {
      "description": "Whether the tag was pushed to `remote`.",
      "type": "boolean"
    },
    "remote": {
      "description": "The remote of --push; null without --push.",
      "type": ["string", "null"]
    },
    "problems": {
      "description": "What stopped the release, for the user; empty when it went ahead or would with --dry-run.",
      "type": "array",
      "items": { "type": "string" }
    }
  },
  "$defs": {
    "commit": {
      "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" }
      }
    }
  }
}
