{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/phoenix/json-schema/phoenix-create-annotation-config-data-schema.json",
  "title": "CreateAnnotationConfigData",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/phoenix-annotation-configs-api-openapi.yml#/components/schemas/CreateAnnotationConfigData",
  "oneOf": [
    {
      "$ref": "#/$defs/CategoricalAnnotationConfigData"
    },
    {
      "$ref": "#/$defs/ContinuousAnnotationConfigData"
    },
    {
      "$ref": "#/$defs/FreeformAnnotationConfigData"
    }
  ],
  "$defs": {
    "CategoricalAnnotationConfigData": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "type": {
          "type": "string",
          "const": "CATEGORICAL",
          "title": "Type"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "title": "Description"
        },
        "optimization_direction": {
          "$ref": "#/$defs/OptimizationDirection"
        },
        "values": {
          "items": {
            "$ref": "#/$defs/CategoricalAnnotationValue"
          },
          "type": "array",
          "title": "Values"
        }
      },
      "type": "object",
      "required": [
        "name",
        "type",
        "optimization_direction",
        "values"
      ],
      "title": "CategoricalAnnotationConfigData"
    },
    "CategoricalAnnotationValue": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label"
        },
        "score": {
          "type": [
            "number",
            "null"
          ],
          "title": "Score"
        }
      },
      "type": "object",
      "required": [
        "label"
      ],
      "title": "CategoricalAnnotationValue"
    },
    "ContinuousAnnotationConfigData": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "type": {
          "type": "string",
          "const": "CONTINUOUS",
          "title": "Type"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "title": "Description"
        },
        "optimization_direction": {
          "$ref": "#/$defs/OptimizationDirection"
        },
        "lower_bound": {
          "type": [
            "number",
            "null"
          ],
          "title": "Lower Bound"
        },
        "upper_bound": {
          "type": [
            "number",
            "null"
          ],
          "title": "Upper Bound"
        }
      },
      "type": "object",
      "required": [
        "name",
        "type",
        "optimization_direction"
      ],
      "title": "ContinuousAnnotationConfigData"
    },
    "FreeformAnnotationConfigData": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "type": {
          "type": "string",
          "const": "FREEFORM",
          "title": "Type"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "title": "Description"
        },
        "optimization_direction": {
          "$ref": "#/$defs/OptimizationDirection"
        },
        "threshold": {
          "type": [
            "number",
            "null"
          ],
          "title": "Threshold"
        },
        "lower_bound": {
          "type": [
            "number",
            "null"
          ],
          "title": "Lower Bound"
        },
        "upper_bound": {
          "type": [
            "number",
            "null"
          ],
          "title": "Upper Bound"
        }
      },
      "type": "object",
      "required": [
        "name",
        "type"
      ],
      "title": "FreeformAnnotationConfigData"
    },
    "OptimizationDirection": {
      "type": "string",
      "enum": [
        "MINIMIZE",
        "MAXIMIZE",
        "NONE"
      ],
      "title": "OptimizationDirection"
    }
  }
}