{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/componecat-ai/json-schema/componecat-ai-rest-api-response-of-scorecard-detail-schema.json",
  "title": "RestApiResponseOfScorecardDetail",
  "description": "Standard REST API response envelope for a single resource.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/componecat-ai-scorecards-api-openapi.yml#/components/schemas/RestApiResponseOfScorecardDetail",
  "required": [
    "data"
  ],
  "type": "object",
  "properties": {
    "data": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/ScorecardDetail"
        }
      ]
    }
  },
  "$defs": {
    "ScorecardDetail": {
      "required": [
        "id",
        "name",
        "displayName",
        "description",
        "scopeQuery",
        "enabled",
        "schedule",
        "levels",
        "status",
        "statusDetail",
        "rules",
        "organizationId",
        "createdAt",
        "updatedAt"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "description": {
          "type": [
            "null",
            "string"
          ]
        },
        "scopeQuery": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "schedule": {
          "type": [
            "null",
            "string"
          ]
        },
        "levels": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "status": {
          "type": "string"
        },
        "statusDetail": {
          "type": [
            "null",
            "string"
          ]
        },
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ScorecardRuleItem"
          }
        },
        "organizationId": {
          "type": "string",
          "format": "uuid"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Scorecard detail view -- the full definition, its scope, and its ordered rules (ADR-011\ndecision 8). string ScorecardDetail.Status/string? ScorecardDetail.StatusDetail report whether the scope or a\nrule query currently compiles (ADR-011 decision 6) -- an `Errored` scorecard's prior\nevaluations still stand, so a report can still be meaningful even while the definition itself\nneeds attention."
    },
    "ScorecardRuleItem": {
      "required": [
        "id",
        "scorecardId",
        "name",
        "description",
        "ruleType",
        "query",
        "weight",
        "level",
        "failureMessage",
        "remediationUrl",
        "displayOrder",
        "createdAt",
        "updatedAt"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "scorecardId": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "null",
            "string"
          ]
        },
        "ruleType": {
          "type": "string"
        },
        "query": {
          "type": [
            "null",
            "string"
          ]
        },
        "weight": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "format": "int32"
        },
        "level": {
          "type": [
            "null",
            "string"
          ]
        },
        "failureMessage": {
          "type": [
            "null",
            "string"
          ]
        },
        "remediationUrl": {
          "type": [
            "null",
            "string"
          ]
        },
        "displayOrder": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "format": "int32"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "A single weighted, optionally-levelled rule within a scorecard (ADR-011 decision 2). A\n`QUERY` rule's string? ScorecardRuleItem.Query is the catalog search expression it tests; a\n`REQUIRED_FIELDS_COMPLETE` rule takes no query (string? ScorecardRuleItem.Query is null) and instead\npasses when every field the entity's kind marks required has a value."
    }
  }
}