{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bernstein-run/json-schema/bernstein-run-sbomgenerate-response-schema.json",
  "title": "SBOMGenerateResponse",
  "description": "Response from POST /sbom/generate.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bernstein-run-sbom-api-openapi.yml#/components/schemas/SBOMGenerateResponse",
  "properties": {
    "serial_number": {
      "type": "string",
      "title": "Serial Number"
    },
    "sbom_format": {
      "type": "string",
      "title": "Sbom Format"
    },
    "component_count": {
      "type": "integer",
      "title": "Component Count"
    },
    "artifact_path": {
      "type": "string",
      "title": "Artifact Path"
    },
    "scan_result": {
      "anyOf": [
        {
          "$ref": "#/$defs/SBOMScanResultResponse"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "serial_number",
    "sbom_format",
    "component_count",
    "artifact_path"
  ],
  "$defs": {
    "SBOMScanResultResponse": {
      "properties": {
        "scanner": {
          "type": "string",
          "title": "Scanner"
        },
        "finding_count": {
          "type": "integer",
          "title": "Finding Count"
        },
        "highest_severity": {
          "type": "string",
          "title": "Highest Severity"
        },
        "findings": {
          "items": {
            "$ref": "#/$defs/SBOMVulnFindingResponse"
          },
          "type": "array",
          "title": "Findings"
        },
        "errors": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Errors"
        },
        "passed_gate": {
          "type": "boolean",
          "title": "Passed Gate"
        }
      },
      "type": "object",
      "required": [
        "scanner",
        "finding_count",
        "highest_severity",
        "findings",
        "errors",
        "passed_gate"
      ],
      "title": "SBOMScanResultResponse",
      "description": "Serialised scan result."
    },
    "SBOMVulnFindingResponse": {
      "properties": {
        "component_name": {
          "type": "string",
          "title": "Component Name"
        },
        "component_version": {
          "type": "string",
          "title": "Component Version"
        },
        "vuln_id": {
          "type": "string",
          "title": "Vuln Id"
        },
        "severity": {
          "type": "string",
          "title": "Severity"
        },
        "summary": {
          "type": "string",
          "title": "Summary"
        },
        "fix_version": {
          "type": "string",
          "title": "Fix Version"
        },
        "scanner": {
          "type": "string",
          "title": "Scanner"
        }
      },
      "type": "object",
      "required": [
        "component_name",
        "component_version",
        "vuln_id",
        "severity",
        "summary",
        "fix_version",
        "scanner"
      ],
      "title": "SBOMVulnFindingResponse",
      "description": "Serialised vulnerability finding."
    }
  }
}