{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currents-dev/json-schema/currents-dev-affected-tests-list-response-schema.json",
  "title": "AffectedTestsListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/currents-dev-actions-api-openapi.yml#/components/schemas/AffectedTestsListResponse",
  "type": "object",
  "required": [
    "status",
    "data"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "OK"
      ]
    },
    "data": {
      "type": "object",
      "required": [
        "list",
        "count",
        "total",
        "nextPage"
      ],
      "properties": {
        "list": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AffectedTestListItem"
          }
        },
        "count": {
          "type": "integer",
          "description": "Number of items in the current page"
        },
        "total": {
          "type": "integer",
          "description": "Total number of affected tests"
        },
        "nextPage": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "boolean",
              "enum": [
                false
              ]
            }
          ],
          "description": "Next page number (0-indexed), or false if no more pages"
        }
      }
    }
  },
  "$defs": {
    "ActionOp": {
      "type": "string",
      "enum": [
        "quarantine",
        "skip",
        "tag"
      ],
      "description": "Action operation: quarantine, skip (do not run), or tag"
    },
    "ActionStatus": {
      "type": "string",
      "enum": [
        "active",
        "disabled",
        "archived",
        "expired"
      ],
      "description": "The current status of the action:\n- `active`: Action is enabled and will be applied to matching tests\n- `disabled`: Action is temporarily disabled\n- `archived`: Action has been soft-deleted\n- `expired`: Action has passed its expiration date"
    },
    "AffectedTestAction": {
      "type": "object",
      "required": [
        "types",
        "name",
        "id",
        "status",
        "expiresAt",
        "lastSeen",
        "recordingCount"
      ],
      "properties": {
        "types": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ActionOp"
          },
          "description": "Action types (a single rule can have multiple operations)"
        },
        "name": {
          "type": "string",
          "description": "Action/rule name"
        },
        "id": {
          "type": "string",
          "description": "Action/rule ID"
        },
        "status": {
          "$ref": "#/$defs/ActionStatus"
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Expiration timestamp, or null if no expiration"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tag values (only present when types includes tag)"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of last execution with this action (in the list date range)"
        },
        "recordingCount": {
          "type": "integer",
          "description": "Number of test recordings with this action (in the list date range)"
        }
      }
    },
    "AffectedTestListItem": {
      "type": "object",
      "required": [
        "signature",
        "title",
        "specFile",
        "actions",
        "lastSeen",
        "recordingCount"
      ],
      "properties": {
        "signature": {
          "type": "string",
          "description": "Unique test signature hash"
        },
        "title": {
          "type": "string",
          "description": "Test title"
        },
        "specFile": {
          "type": "string",
          "description": "Spec file path"
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AffectedTestAction"
          },
          "description": "Actions applied to this test"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time",
          "description": "Last time this test was seen"
        },
        "recordingCount": {
          "type": "integer",
          "description": "Number of test recordings in the date range"
        }
      }
    }
  }
}