{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hacktron/json-schema/hacktron-merged-repos-response-dto-schema.json",
  "title": "MergedReposResponseDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hacktron-rest-api-repos-api-openapi.yml#/components/schemas/MergedReposResponseDto",
  "type": "object",
  "properties": {
    "repos": {
      "description": "Unified list of repositories from all providers",
      "type": "array",
      "items": {
        "$ref": "#/$defs/UnifiedRepoDto"
      }
    },
    "errors": {
      "description": "Providers that failed to respond",
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "repos",
    "errors"
  ],
  "$defs": {
    "UnifiedRepoDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Internal UUID"
        },
        "provider": {
          "type": "string",
          "description": "Source provider",
          "enum": [
            "github",
            "gitlab",
            "bitbucket",
            "azure"
          ]
        },
        "name": {
          "type": "string",
          "description": "Display name (owner/repo for GitHub, namespace/project for GitLab, workspace/slug for Bitbucket, project/repository for Azure DevOps)"
        },
        "providerKey": {
          "type": "string",
          "description": "Provider-native identifier for mutation endpoints. GitHub: owner/repo, GitLab: numeric projectId (as string), Bitbucket: repository UUID, Azure DevOps: repository UUID."
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the repository is enabled for scanning"
        },
        "threatModelUpdatedAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO timestamp of the repo's most recent threat_model.md update, or null if it has none. Repos are returned ordered by this (most recent first; repos without a threat model last)."
        },
        "openFindingsCount": {
          "type": "number",
          "description": "Number of approved, visible findings that remain open for this repository"
        },
        "lastScanAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO timestamp of the most recent completed scan containing this repository, or null if it has not been scanned"
        },
        "ossApproved": {
          "type": "boolean",
          "description": "Whether this github.com repository is approved for free OSS PR reviews. Independent of whether PR scans are enabled."
        },
        "prScansEnabled": {
          "type": "boolean",
          "description": "Whether PR/MR scans are enabled (GitHub and GitLab)"
        },
        "prScanBranches": {
          "description": "Target branch patterns for PR/MR scans (GitHub and GitLab)",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "installationId": {
          "type": "number",
          "description": "GitHub App installation ID (GitHub only)"
        },
        "baseUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "GitHub Enterprise base URL for self-hosted (PAT) installations (null/absent for github.com), the GitLab installation URL, or the Azure DevOps organization URL. Clients should build clone/display URLs from this host instead of assuming the public provider host."
        },
        "defaultBranch": {
          "type": "string",
          "description": "Default branch (GitLab only)"
        },
        "visibility": {
          "type": "string",
          "description": "Project visibility (GitLab only)"
        },
        "webhookRegistered": {
          "type": "boolean",
          "description": "Whether a webhook is registered for this project (GitLab only)"
        },
        "isPrivate": {
          "type": "boolean",
          "description": "Whether the repository is private (Bitbucket only)"
        }
      },
      "required": [
        "id",
        "provider",
        "name",
        "providerKey",
        "enabled",
        "threatModelUpdatedAt",
        "openFindingsCount",
        "lastScanAt"
      ]
    }
  }
}