{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peppolstatus-com/json-schema/peppolstatus-com-compliance-rule-catalogue-schema.json",
  "title": "ComplianceRuleCatalogue",
  "description": "The full rule catalogue.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peppolstatus-com-compliance-api-openapi.yml#/components/schemas/ComplianceRuleCatalogue",
  "type": "object",
  "required": [
    "rules",
    "generated_at"
  ],
  "properties": {
    "rules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ComplianceRule"
      }
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "ComplianceRule": {
      "type": "object",
      "description": "One published rule registrations are judged against.",
      "required": [
        "code",
        "title",
        "description",
        "scope",
        "country",
        "applies_to",
        "grade",
        "version",
        "effective_from",
        "effective_to",
        "source_url"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable public rule code."
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string",
          "description": "What the rule requires, in prose."
        },
        "scope": {
          "type": "string",
          "enum": [
            "global",
            "country"
          ],
          "description": "Network-wide, or scoped to one Peppol Authority's country."
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO 3166-1 alpha-2 when scoped."
        },
        "applies_to": {
          "type": "string",
          "description": "The subject class the rule judges (e.g. `smp_certificate`)."
        },
        "grade": {
          "type": "string",
          "enum": [
            "fatal",
            "warning",
            "notice"
          ]
        },
        "version": {
          "type": "string",
          "description": "Bumped when the verdict logic changes; findings record it."
        },
        "effective_from": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "effective_to": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "source_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "The published rule text."
        }
      }
    }
  }
}