{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hacktron/json-schema/hacktron-rest-finding-detail-response-dto-schema.json",
  "title": "RestFindingDetailResponseDto",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hacktron-openapi.json#/components/schemas/RestFindingDetailResponseDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Finding UUID"
    },
    "display_id": {
      "type": "string",
      "description": "Human-readable id (KEY-FD-NUMBER)."
    },
    "number": {
      "type": "integer",
      "description": "Per-organization sequence number behind display_id."
    },
    "title": {
      "type": "string"
    },
    "category": {
      "type": "string"
    },
    "severity": {
      "type": "string",
      "enum": [
        "critical",
        "high",
        "medium",
        "low",
        "info"
      ]
    },
    "state": {
      "type": "string",
      "enum": [
        "open",
        "true_positive",
        "false_positive",
        "accepted_risk",
        "resolved",
        "closed"
      ]
    },
    "description": {
      "type": "string"
    },
    "affected_file": {
      "type": "string"
    },
    "affected_code": {
      "type": "string"
    },
    "proof_of_concept": {
      "type": [
        "string",
        "null"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "scan_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "found_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "resolved_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "Timestamp of the most recent transition to resolved (ISO 8601). Null if never resolved."
    },
    "triage_thread": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RestTriageThreadEntryDto"
      }
    },
    "taint_path": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TaintStepDto"
      }
    },
    "occurrence_count": {
      "type": "number"
    },
    "repo_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "scan_type": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "display_id",
    "number",
    "title",
    "category",
    "severity",
    "state",
    "description",
    "affected_file",
    "affected_code",
    "proof_of_concept",
    "tags",
    "scan_id",
    "found_at",
    "updated_at",
    "resolved_at",
    "triage_thread",
    "taint_path",
    "occurrence_count",
    "repo_url",
    "scan_type"
  ],
  "$defs": {
    "RestTriageThreadEntryDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "reaction": {
          "type": [
            "string",
            "null"
          ]
        },
        "comment": {
          "type": [
            "string",
            "null"
          ]
        },
        "user_id": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "timestamp": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "reaction",
        "comment",
        "user_id",
        "source",
        "timestamp"
      ]
    },
    "TaintStepDto": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "source",
            "propagation",
            "sink"
          ]
        },
        "file": {
          "type": "string"
        },
        "line": {
          "type": "number"
        },
        "end_line": {
          "type": "number"
        },
        "symbol": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "detail": {
          "type": "string",
          "description": "Raw symbol docstring; supplemental context for the stepped taint flow."
        },
        "taint_sources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "code": {
          "type": "string",
          "description": "Source code lines for this step's symbol, pre-sliced by the worker."
        },
        "code_start_line": {
          "type": "number",
          "description": "1-based start line number of the `code` slice in the source file. Used by the frontend as the anchor for chevron-expand requests to GET /findings/:uuid/source."
        },
        "code_end_line": {
          "type": "number",
          "description": "1-based end line number of the `code` slice in the source file. Used by the frontend as the anchor for chevron-expand requests to GET /findings/:uuid/source."
        }
      },
      "required": [
        "type",
        "file",
        "line",
        "end_line",
        "symbol",
        "description",
        "taint_sources"
      ]
    }
  }
}