{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xcodebuildmcp.com/schemas/structured-output/xcodebuildmcp.output.coverage-result/2.schema.json",
  "type": "object",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/errorConsistency"
    }
  ],
  "properties": {
    "schema": {
      "const": "xcodebuildmcp.output.coverage-result"
    },
    "schemaVersion": {
      "const": "2"
    },
    "didError": {
      "type": "boolean"
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "data": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "summary": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "status": {
              "enum": [
                "SUCCEEDED",
                "FAILED"
              ]
            },
            "coveragePct": {
              "type": "number",
              "minimum": 0,
              "maximum": 100
            },
            "coveredLines": {
              "type": "integer",
              "minimum": 0
            },
            "executableLines": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "status"
          ]
        },
        "coverageScope": {
          "enum": [
            "report",
            "file"
          ]
        },
        "artifacts": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "xcresultPath": {
              "type": "string"
            },
            "target": {
              "type": "string"
            },
            "file": {
              "type": "string"
            },
            "sourceFilePath": {
              "type": "string"
            }
          },
          "required": [
            "xcresultPath"
          ]
        },
        "targets": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "coveragePct": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "coveredLines": {
                "type": "integer",
                "minimum": 0
              },
              "executableLines": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "name",
              "coveragePct",
              "coveredLines",
              "executableLines"
            ]
          }
        },
        "functions": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "notCovered": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "line": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "name": {
                    "type": "string"
                  },
                  "coveredLines": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "executableLines": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "line",
                  "name",
                  "coveredLines",
                  "executableLines"
                ]
              }
            },
            "partialCoverage": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "line": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "name": {
                    "type": "string"
                  },
                  "coveredLines": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "executableLines": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "coveragePct": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  }
                },
                "required": [
                  "line",
                  "name",
                  "coveragePct",
                  "coveredLines",
                  "executableLines"
                ]
              }
            },
            "fullCoverageCount": {
              "type": "integer",
              "minimum": 0
            },
            "notCoveredFunctionCount": {
              "type": "integer",
              "minimum": 0
            },
            "notCoveredLineCount": {
              "type": "integer",
              "minimum": 0
            },
            "partialCoverageFunctionCount": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "fullCoverageCount",
            "notCoveredFunctionCount",
            "notCoveredLineCount",
            "partialCoverageFunctionCount"
          ]
        },
        "diagnostics": {
          "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/basicDiagnostics"
        }
      },
      "required": [
        "summary",
        "coverageScope",
        "artifacts"
      ]
    },
    "nextSteps": {
      "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/nextSteps"
    }
  },
  "required": [
    "schema",
    "schemaVersion",
    "didError",
    "error",
    "data"
  ]
}
