{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/superflag-sh/json-schema/superflag-sh-rollout-plan-approve-request-schema.json",
  "title": "RolloutPlanApproveRequest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/superflag-sh-openapi.json#/components/schemas/RolloutPlanApproveRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "appId",
    "env",
    "planVersion",
    "recommendationDigest",
    "idempotencyKey"
  ],
  "properties": {
    "appId": {
      "type": "string"
    },
    "env": {
      "type": "string"
    },
    "planVersion": {
      "type": "integer",
      "minimum": 1
    },
    "recommendationDigest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "rollback": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source",
        "ifCurrent",
        "planHash"
      ],
      "properties": {
        "source": {
          "$ref": "#/$defs/RollbackState"
        },
        "ifCurrent": {
          "$ref": "#/$defs/RollbackState"
        },
        "planHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      }
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 16,
      "maxLength": 128
    },
    "dryRun": {
      "type": "boolean"
    },
    "source": {
      "type": "string",
      "enum": [
        "cli",
        "api",
        "agent"
      ]
    },
    "reason": {
      "type": "string"
    },
    "expectedConfigVersion": {
      "type": "integer",
      "minimum": 0
    }
  },
  "$defs": {
    "RollbackState": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "configVersion",
        "experiments"
      ],
      "properties": {
        "configVersion": {
          "type": "integer",
          "minimum": 0
        },
        "experiments": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "experimentVersion"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "experimentVersion": {
                "type": "integer",
                "minimum": 1
              }
            }
          }
        }
      }
    }
  }
}