{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/superflag-sh/json-schema/superflag-sh-experiment-power-analysis-request-schema.json",
  "title": "ExperimentPowerAnalysisRequest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/superflag-sh-openapi.json#/components/schemas/ExperimentPowerAnalysisRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "appId",
    "env",
    "mde",
    "eligiblePopulation",
    "trafficRatePerDay"
  ],
  "properties": {
    "appId": {
      "type": "string"
    },
    "env": {
      "type": "string"
    },
    "baseline": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "rate"
          ],
          "properties": {
            "kind": {
              "const": "conversion"
            },
            "rate": {
              "type": "number"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "mean",
            "variance"
          ],
          "properties": {
            "kind": {
              "const": "mean"
            },
            "mean": {
              "type": "number"
            },
            "variance": {
              "type": "number",
              "minimum": 0
            }
          }
        }
      ]
    },
    "baselineId": {
      "type": "string"
    },
    "baselineVersion": {
      "type": "integer",
      "minimum": 1
    },
    "mde": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "absolute",
            "relative"
          ]
        },
        "value": {
          "type": "number"
        }
      }
    },
    "allocation": {
      "type": "array",
      "minItems": 2,
      "items": {
        "$ref": "#/$defs/WeightedVariation"
      }
    },
    "alpha": {
      "type": "number",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 1
    },
    "power": {
      "type": "number",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 1
    },
    "eligiblePopulation": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "trafficRatePerDay": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "experimentId": {
      "type": "string"
    }
  },
  "$defs": {
    "WeightedVariation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "variation",
        "weight"
      ],
      "properties": {
        "variation": {
          "type": "string",
          "minLength": 1
        },
        "weight": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100000
        }
      }
    }
  }
}