{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fermyontechnologies/json-schema/fermyontechnologies-channel-item-schema.json",
  "title": "ChannelItem",
  "x-generated": "2026-12-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fermyontechnologies-openapi.json#/components/schemas/ChannelItem",
  "required": [
    "appId",
    "desiredStatus",
    "domain",
    "environmentVariables",
    "id",
    "name",
    "revisionSelectionStrategy"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "appId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "minLength": 1,
      "type": "string"
    },
    "domain": {
      "minLength": 1,
      "type": "string"
    },
    "revisionSelectionStrategy": {
      "$ref": "#/$defs/ChannelRevisionSelectionStrategy"
    },
    "desiredStatus": {
      "minLength": 1,
      "type": "string"
    },
    "activeRevision": {
      "$ref": "#/$defs/RevisionItem"
    },
    "lastPublishAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "rangeRule": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastModified": {
      "type": "string",
      "format": "date-time"
    },
    "appSummary": {
      "$ref": "#/$defs/AppSummaryDto"
    },
    "environmentVariables": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EnvironmentVariableItem"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ApiHealthStatus": {
      "enum": [
        "Healthy",
        "Unhealthy",
        "Degraded"
      ],
      "type": "string"
    },
    "AppChannelListItem": {
      "required": [
        "created",
        "id",
        "name"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        },
        "activeRevisionNumber": {
          "type": "string"
        },
        "domain": {
          "type": "string"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "healthStatus": {
          "$ref": "#/$defs/ApiHealthStatus"
        },
        "lastModified": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "AppSummaryDto": {
      "required": [
        "channels",
        "id",
        "name",
        "storageId"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        },
        "storageId": {
          "minLength": 1,
          "type": "string"
        },
        "channels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AppChannelListItem"
          }
        },
        "lastModified": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "ChannelRevisionSelectionStrategy": {
      "enum": [
        "UseRangeRule",
        "UseSpecifiedRevision"
      ],
      "type": "string"
    },
    "EnvironmentVariableItem": {
      "required": [
        "channelId",
        "key",
        "value"
      ],
      "type": "object",
      "properties": {
        "channelId": {
          "type": "string",
          "format": "uuid"
        },
        "key": {
          "minLength": 1,
          "type": "string"
        },
        "value": {
          "minLength": 1,
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "RevisionComponentDto": {
      "required": [
        "id",
        "name",
        "source"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "source": {
          "minLength": 1,
          "type": "string"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        },
        "route": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "RevisionItem": {
      "required": [
        "appId",
        "components",
        "id",
        "revisionNumber"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "appId": {
          "type": "string",
          "format": "uuid"
        },
        "revisionNumber": {
          "minLength": 1,
          "type": "string"
        },
        "components": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RevisionComponentDto"
          },
          "readOnly": true
        },
        "lastModified": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": false
    }
  }
}