{
  "type": "object",
  "properties": {
    "tags": {
      "type": [
        "null",
        "array"
      ],
      "items": {
        "type": [
          "null",
          "object"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the tag"
          },
          "versions": {
            "type": "object",
            "description": "Versions to use for this tag",
            "additionalProperties": {
              "type": "string"
            }
          },
          "build_args": {
            "type": "object",
            "description": "Build args to specify for this tag",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "description": "Tags to create for this image"
    },
    "variants": {
      "type": [
        "null",
        "array"
      ],
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the variant"
          },
          "tag_suffix": {
            "type": "string",
            "description": "Suffix to append to the tag name for this variant"
          },
          "versions": {
            "type": "object",
            "description": "Versions to use for this variant",
            "additionalProperties": {
              "type": "string"
            }
          },
          "build_args": {
            "type": "object",
            "description": "Build args to add for this variant",
            "additionalProperties": {
              "type": "string"
            }
          },
          "platforms": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Target platforms for this variant (e.g. linux/amd64)"
          }
        },
        "required": [
          "name",
          "tag_suffix"
        ],
        "additionalProperties": false
      },
      "description": "Variants to create for this image"
    },
    "versions": {
      "type": "object",
      "description": "Versions to use for this image",
      "additionalProperties": {
        "type": "string"
      }
    },
    "build_args": {
      "type": "object",
      "description": "Build args to add for this image",
      "additionalProperties": {
        "type": "string"
      }
    },
    "secrets": {
      "type": "object",
      "description": "Secrets to resolve for this image",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "description": "Source type of the secret (env, plain). If omitted, auto-detected from value."
          },
          "value": {
            "type": "string",
            "description": "Value of the secret (env var name or plain text)"
          }
        },
        "required": [
          "value"
        ],
        "additionalProperties": false
      }
    },
    "depends_on": {
      "type": [
        "null",
        "array"
      ],
      "items": {
        "type": "string"
      },
      "description": "Names of other images in this project that must be built before this image"
    },
    "platforms": {
      "type": [
        "null",
        "array"
      ],
      "items": {
        "type": "string"
      },
      "description": "Target platforms for this image (e.g. linux/amd64)"
    },
    "latest_alias": {
      "type": [
        "null",
        "object"
      ],
      "properties": {
        "tag": {
          "type": "string",
          "description": "Alias tag name to assign to the highest semantic version (e.g. latest, stable),required"
        },
        "on_missing": {
          "type": "string",
          "description": "Behaviour when no semantic tags are found: error (default), warning, silent"
        }
      },
      "description": "Configure an alias pointing to the highest semantic version tag",
      "required": [
        "tag"
      ],
      "additionalProperties": false
    }
  },
  "$id": "https://container-hive.timo-reymann.de/schemas/image.schema.json",
  "title": "Image definition",
  "description": "Image definition configuration schema for ContainerHive.",
  "required": [
    "tags"
  ],
  "additionalProperties": false
}