{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currents-dev/json-schema/currents-dev-test-results-response-schema.json",
  "title": "TestResultsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/currents-dev-test-results-api-openapi.yml#/components/schemas/TestResultsResponse",
  "type": "object",
  "required": [
    "status",
    "has_more",
    "data"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "OK"
      ]
    },
    "has_more": {
      "type": "boolean"
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TestResult"
      }
    }
  },
  "$defs": {
    "RecordedTestOutcome": {
      "type": "string",
      "description": "Final per-test outcome stored in Currents.\n\n- **passed** — Runner reported success.\n- **failed** — Runner reported failure (assertions, errors, timeouts, etc.).\n- **pending** — Intentional skip or disabled test (e.g. `test.skip()` / `it.skip()`). In **Tests Explorer** (`GET /tests/{projectId}`) this increments `metrics.ignored` and does **not** increment `metrics.failures`.\n- **skipped** — Runner reported a skip without a normal pass/fail (often interrupted or never executed as pass/fail). In **Tests Explorer** this increments `metrics.failures` together with `failed` (there is no separate `skipped` counter in that response). On **run and spec** payloads, `stats.skipped` is still reported separately from `stats.failures` and `stats.pending`.",
      "enum": [
        "passed",
        "failed",
        "pending",
        "skipped"
      ]
    },
    "TestResult": {
      "type": "object",
      "properties": {
        "cursor": {
          "type": "string"
        },
        "signature": {
          "type": "string"
        },
        "framework": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "projectId": {
          "type": "string"
        },
        "groupId": {
          "type": "string"
        },
        "runId": {
          "type": "string"
        },
        "instanceId": {
          "type": "string"
        },
        "spec": {
          "type": "string"
        },
        "machineId": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "title": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "testId": {
          "type": "string"
        },
        "displayError": {
          "type": [
            "string",
            "null"
          ]
        },
        "commit": {
          "type": "object",
          "properties": {
            "branch": {
              "type": "string"
            },
            "authorEmail": {
              "type": "string"
            },
            "authorName": {
              "type": "string"
            },
            "sha": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        },
        "duration": {
          "type": "integer"
        },
        "flaky": {
          "type": "boolean"
        },
        "expectedStatus": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "$ref": "#/$defs/RecordedTestOutcome"
        },
        "attempts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "attemptId": {
                "type": "string"
              },
              "state": {
                "type": "string"
              },
              "error": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "stack": {
                    "type": "string"
                  },
                  "location": {
                    "type": "object"
                  }
                }
              },
              "startedAt": {
                "type": "string",
                "format": "date-time"
              },
              "duration": {
                "type": "integer"
              }
            }
          }
        },
        "annotations": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}