{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/build-changelog/latest.json",
  "title": "build-changelog",
  "description": "Schema for changelog files.",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/jelmore1674/build-changelog/refs/tags/v1/schemas/changlelog.json",
    "sourceSha256": "28d6dd3561bd3ac273f26fb2e7bd6a8879efb4415b55f9354423a20d3fb83f0f",
    "fileMatch": [
      "**/build-changelog/*.yml",
      "**/build-changelog/*.yaml",
      "**/build-changelog/*.toml"
    ],
    "parsers": [
      "toml",
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "added": {
      "$ref": "#/$defs/change_entry",
      "description": "Changes where you add to the project."
    },
    "changed": {
      "$ref": "#/$defs/change_entry",
      "description": "Changes where you changed functionality."
    },
    "removed": {
      "$ref": "#/$defs/change_entry",
      "description": "Changes where you removed a feature or something else."
    },
    "fixed": {
      "$ref": "#/$defs/change_entry",
      "description": "Changes where you fixed a bug."
    },
    "security": {
      "$ref": "#/$defs/change_entry",
      "description": "Changes where you made an update for security reasons."
    },
    "deprecated": {
      "$ref": "#/$defs/change_entry",
      "description": "Changes where you plan on removing something, but are waiting to do so."
    },
    "version": {
      "type": "string",
      "description": "The current version of the project. If left off this will fallback to being `Unreleased`."
    },
    "release_date": {
      "type": "string",
      "description": "The release date of the current version. If this is property is not defined this will fall back to `TBD`."
    },
    "notice": {
      "type": "string",
      "description": "A notice for the current release."
    },
    "change": {
      "type": "string",
      "enum": [
        "major",
        "minor",
        "patch"
      ],
      "description": "The type of change you are creating. Valid values are `major` | `minor` | `patch`"
    }
  },
  "$defs": {
    "simple_change_entry": {
      "type": "array",
      "description": "This is a simple change entry.",
      "items": {
        "type": "string",
        "description": "Simple change entry."
      }
    },
    "breaking_change_entry": {
      "type": "object",
      "description": "The main release object",
      "properties": {
        "breaking": {
          "type": "array",
          "description": "The change entry messages.",
          "items": {
            "type": "string",
            "description": "The change entry message."
          },
          "additionalProperties": false
        }
      }
    },
    "complex_change_entry": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "message": {
            "description": "The change entry message.",
            "type": "string"
          },
          "flag": {
            "description": "The flag to add a prefix to the changes.",
            "type": "string"
          },
          "references": {
            "type": "array",
            "description": "List of references to this current change.",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "description": "The type of reference, can be `pull_request`,`pr`, or `issue`",
                  "type": "string",
                  "enum": [
                    "pull_request",
                    "issue"
                  ]
                },
                "number": {
                  "description": "The pull request or issue number",
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "change_entry": {
      "anyOf": [
        {
          "$ref": "#/$defs/simple_change_entry"
        },
        {
          "$ref": "#/$defs/complex_change_entry"
        },
        {
          "$ref": "#/$defs/breaking_change_entry"
        }
      ]
    }
  }
}
