{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/repowise-dev/json-schema/repowise-dev-coupling-areas-response-schema.json",
  "title": "CouplingAreasResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/repowise-dev-coupling-api-openapi.yml#/components/schemas/CouplingAreasResponse",
  "properties": {
    "root": {
      "type": "string",
      "title": "Root"
    },
    "depth": {
      "type": "integer",
      "title": "Depth"
    },
    "totals": {
      "$ref": "#/$defs/CouplingAreaTotals"
    },
    "areas": {
      "items": {
        "$ref": "#/$defs/CouplingAreaSummary"
      },
      "type": "array",
      "title": "Areas"
    },
    "area_pairs": {
      "items": {
        "$ref": "#/$defs/CouplingAreaPair"
      },
      "type": "array",
      "title": "Area Pairs"
    }
  },
  "type": "object",
  "required": [
    "root",
    "depth",
    "totals"
  ],
  "$defs": {
    "CouplingAreaPair": {
      "properties": {
        "pairs": {
          "type": "integer",
          "title": "Pairs"
        },
        "unexplained_pairs": {
          "type": "integer",
          "title": "Unexplained Pairs"
        },
        "unexplained_share": {
          "type": "number",
          "title": "Unexplained Share"
        },
        "strength": {
          "type": "number",
          "title": "Strength"
        },
        "co_changes": {
          "type": "integer",
          "title": "Co Changes"
        },
        "last_co_change": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Co Change"
        },
        "linked": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Linked"
        },
        "hidden": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hidden"
        },
        "source": {
          "type": "string",
          "title": "Source"
        },
        "target": {
          "type": "string",
          "title": "Target"
        },
        "top_pairs": {
          "items": {
            "$ref": "#/$defs/CouplingEdgeResponse"
          },
          "type": "array",
          "title": "Top Pairs"
        }
      },
      "type": "object",
      "required": [
        "pairs",
        "unexplained_pairs",
        "unexplained_share",
        "strength",
        "co_changes",
        "source",
        "target"
      ],
      "title": "CouplingAreaPair",
      "description": "Two areas whose files change together; ``source == target`` for same-area pairs."
    },
    "CouplingAreaSummary": {
      "properties": {
        "pairs": {
          "type": "integer",
          "title": "Pairs"
        },
        "unexplained_pairs": {
          "type": "integer",
          "title": "Unexplained Pairs"
        },
        "unexplained_share": {
          "type": "number",
          "title": "Unexplained Share"
        },
        "strength": {
          "type": "number",
          "title": "Strength"
        },
        "co_changes": {
          "type": "integer",
          "title": "Co Changes"
        },
        "last_co_change": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Co Change"
        },
        "linked": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Linked"
        },
        "hidden": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hidden"
        },
        "path": {
          "type": "string",
          "title": "Path"
        }
      },
      "type": "object",
      "required": [
        "pairs",
        "unexplained_pairs",
        "unexplained_share",
        "strength",
        "co_changes",
        "path"
      ],
      "title": "CouplingAreaSummary",
      "description": "One area's coupling: every kept pair with a file in it."
    },
    "CouplingAreaTotals": {
      "properties": {
        "pairs": {
          "type": "integer",
          "title": "Pairs"
        },
        "cross_area_pairs": {
          "type": "integer",
          "title": "Cross Area Pairs"
        },
        "unexplained_pairs": {
          "type": "integer",
          "title": "Unexplained Pairs"
        },
        "area_pairs": {
          "type": "integer",
          "title": "Area Pairs"
        },
        "unexplained_area_pairs": {
          "type": "integer",
          "title": "Unexplained Area Pairs"
        },
        "hidden_area_pairs": {
          "type": "integer",
          "title": "Hidden Area Pairs"
        },
        "unlabelled_pairs": {
          "type": "integer",
          "title": "Unlabelled Pairs"
        }
      },
      "type": "object",
      "required": [
        "pairs",
        "cross_area_pairs",
        "unexplained_pairs",
        "area_pairs",
        "unexplained_area_pairs",
        "hidden_area_pairs",
        "unlabelled_pairs"
      ],
      "title": "CouplingAreaTotals"
    },
    "CouplingEdgeResponse": {
      "properties": {
        "source": {
          "type": "string",
          "title": "Source"
        },
        "target": {
          "type": "string",
          "title": "Target"
        },
        "strength": {
          "type": "number",
          "title": "Strength"
        },
        "last_co_change": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Co Change"
        },
        "support": {
          "type": "integer",
          "title": "Support",
          "default": 0
        },
        "confidence_ab": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence Ab"
        },
        "confidence_ba": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence Ba"
        },
        "structural": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "corroborated",
                "unexplained",
                "not_applicable"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Structural"
        },
        "dependency_kind": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dependency Kind"
        },
        "cross_area": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cross Area"
        }
      },
      "type": "object",
      "required": [
        "source",
        "target",
        "strength"
      ],
      "title": "CouplingEdgeResponse"
    }
  }
}