{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/buildpulse-io/json-schema/buildpulse-io-flaky-tests-response-schema.json",
  "title": "FlakyTestsResponse",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/buildpulse-io-openapi.yaml#/components/schemas/FlakyTestsResponse",
  "type": "object",
  "required": [
    "count",
    "tests",
    "metadata"
  ],
  "properties": {
    "count": {
      "type": "integer",
      "format": "int64"
    },
    "tests": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FlakyTest"
      }
    },
    "metadata": {
      "$ref": "#/$defs/Metadata"
    }
  },
  "$defs": {
    "FlakyTest": {
      "type": "object",
      "description": "Base shape (no `include` param). Add fields by listing them in\nthe `include` query parameter — see endpoint description for the\nwhitelist.\n",
      "required": [
        "id",
        "name",
        "suite",
        "class",
        "file"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "suite": {
          "type": "string"
        },
        "class": {
          "type": "string"
        },
        "file": {
          "type": "string"
        },
        "disruptiveness_ratio": {
          "type": "number",
          "format": "float",
          "description": "Only present when `include` lists `disruptiveness_ratio`."
        },
        "disruption_count": {
          "type": "integer",
          "description": "Only present when `include` lists `nondeterministic_negative_result_count`."
        },
        "first_disruption_at": {
          "type": "string",
          "format": "date-time",
          "description": "Only present when `include` lists `nondeterminism_first_recorded_at`."
        },
        "recent_disruption_commit_oid": {
          "type": "string",
          "description": "Only present when `include` lists `recent_nondeterministic_commit_oid`."
        },
        "recent_nondeterministic_negative_result": {
          "$ref": "#/$defs/Result"
        },
        "recent_nondeterministic_positive_result": {
          "$ref": "#/$defs/Result"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "quarantine_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "quarantined_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "quarantine_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "time_consumed": {
          "type": "integer",
          "format": "int64"
        },
        "pass_rate": {
          "type": "number",
          "format": "float",
          "description": "Fraction of runs in which this test passed (0.0–1.0). Only\npresent when `include` lists `pass_rate`.\n"
        },
        "avg_duration_ms": {
          "type": "number",
          "format": "float",
          "description": "Average per-attempt duration in milliseconds across all\nrecorded runs of this test. Only present when `include`\nlists `avg_duration_ms`.\n"
        }
      }
    },
    "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"
        }
      }
    },
    "Result": {
      "type": "object",
      "required": [
        "recorded_at",
        "build_url",
        "message"
      ],
      "properties": {
        "recorded_at": {
          "type": "string",
          "format": "date-time"
        },
        "build_url": {
          "type": "string",
          "format": "uri"
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "Failure message (negative result) or always `null`\n(positive result, to match legacy behavior).\n"
        }
      }
    }
  }
}