{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/buildpulse-io/json-schema/buildpulse-io-submission-tests-response-schema.json",
  "title": "SubmissionTestsResponse",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/buildpulse-io-openapi.yaml#/components/schemas/SubmissionTestsResponse",
  "type": "object",
  "required": [
    "count",
    "tests",
    "metadata"
  ],
  "properties": {
    "count": {
      "type": "integer",
      "format": "int64",
      "description": "Total matching test results (not just this page)."
    },
    "tests": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SubmissionTest"
      }
    },
    "metadata": {
      "$ref": "#/$defs/Metadata"
    }
  },
  "$defs": {
    "Metadata": {
      "type": "object",
      "required": [
        "after",
        "limit"
      ],
      "properties": {
        "after": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque cursor for the next page; `null` if there is no next page."
        },
        "limit": {
          "type": "integer"
        }
      }
    },
    "SubmissionTest": {
      "type": "object",
      "required": [
        "id",
        "test_case_id",
        "name",
        "suite",
        "class",
        "file",
        "conclusion",
        "duration_us",
        "message",
        "body",
        "ran_at",
        "run_count"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Test result identifier (24-char hex ObjectID)."
        },
        "test_case_id": {
          "type": "string",
          "description": "Parent test case identifier (24-char hex ObjectID). Two\nresults with the same `test_case_id` are different runs of\nthe same logical test (e.g. retries within one submission).\n"
        },
        "name": {
          "type": "string"
        },
        "suite": {
          "type": "string"
        },
        "class": {
          "type": "string"
        },
        "file": {
          "type": "string"
        },
        "conclusion": {
          "type": "string",
          "enum": [
            "passing",
            "failure",
            "error",
            "skipped",
            "unknown"
          ],
          "description": "Outcome of this attempt. `failed` in the `status` filter\nmatches both `failure` and `error`.\n"
        },
        "duration_us": {
          "type": "integer",
          "format": "int64",
          "description": "Per-attempt duration in microseconds."
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "One-line failure or error summary as recorded by the runner;\nnull for passing / skipped.\n"
        },
        "body": {
          "type": [
            "string",
            "null"
          ],
          "description": "Full failure detail (assertion + stack trace); null for\npassing / skipped. Truncated at 2000 bytes on the wire\n(UTF-8 safe, never split mid-codepoint); the authoritative\ncopy lives in the underlying testResults row.\n"
        },
        "ran_at": {
          "type": "string",
          "format": "date-time"
        },
        "run_count": {
          "type": "integer",
          "description": "Retry attempt number recorded by the test runner. `1` for\nthe first attempt, `2` for the first retry, etc.\n"
        }
      }
    }
  }
}