{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/buildpulse-io/json-schema/buildpulse-io-submissions-response-schema.json",
  "title": "SubmissionsResponse",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/buildpulse-io-openapi.yaml#/components/schemas/SubmissionsResponse",
  "type": "object",
  "required": [
    "count",
    "submissions",
    "metadata"
  ],
  "properties": {
    "count": {
      "type": "integer",
      "format": "int64",
      "description": "Total submissions matching the filter (not just this page)."
    },
    "submissions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Submission"
      }
    },
    "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"
        }
      }
    },
    "Submission": {
      "type": "object",
      "required": [
        "id",
        "key",
        "build_url",
        "commit_oid",
        "recorded_at",
        "status",
        "test_result_count"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Submission identifier (24-char hex ObjectID). Pass to\n`/api/repos/{owner}/{name}/submissions/{submission_id}/tests`\nto fetch the per-test results for this submission.\n"
        },
        "key": {
          "type": "string",
          "description": "Legacy S3 object key for the raw test result archive. Stable\nand unique per submission in the legacy stack; empty string\non the new pipeline. Prefer `id` for cross-endpoint joins.\n"
        },
        "build_url": {
          "type": "string",
          "format": "uri",
          "description": "CI run URL that produced this submission."
        },
        "commit_oid": {
          "type": "string",
          "description": "Git commit SHA-1 (40 hex chars)."
        },
        "recorded_at": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp (UTC, second precision)."
        },
        "status": {
          "type": "string",
          "description": "Processing status. Currently `processed`, `processing`, or\nother internal states.\n"
        },
        "test_result_count": {
          "type": "integer",
          "description": "Number of individual test results in this submission. Counts every\nrecorded attempt — retries and skipped tests included — so it can\nexceed the number of distinct tests in the run.\n"
        }
      }
    }
  }
}