{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/attestwire-com/json-schema/attestwire-com-versions-schema.json",
  "title": "Versions",
  "description": "The body of GET /v1/versions: the running engine, the KoSIT record, and one entry per release of the engine.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/attestwire-com-meta-api-openapi.yml#/components/schemas/Versions",
  "type": "object",
  "required": [
    "engine",
    "engine_version",
    "ruleset",
    "rule_id_count",
    "kosit_conformance",
    "releases",
    "derivation"
  ],
  "properties": {
    "engine": {
      "type": "string"
    },
    "engine_version": {
      "type": "string"
    },
    "ruleset": {
      "type": "string"
    },
    "rule_id_count": {
      "type": "integer",
      "description": "Every rule id the compiled engine checks — which is more than the release notes have ever named, so this will not equal the sum of the `rules_added` arrays below."
    },
    "kosit_conformance": {
      "$ref": "#/$defs/KositConformance"
    },
    "releases": {
      "type": "array",
      "description": "Newest first.",
      "items": {
        "$ref": "#/$defs/Release"
      }
    },
    "derivation": {
      "type": "string",
      "description": "How `rules_added` is derived, published in the body so nobody over-reads the list. Prose; do not parse it."
    }
  },
  "$defs": {
    "KositConformance": {
      "type": "object",
      "description": "When the official KoSIT validator was last run against this engine's committed fixtures, and with what.\n\n**NOTHING IS SENT TO KoSIT WHEN YOU CALL US.** This is a dated record of a check we ran on release, not a per-call verification, and it says nothing about YOUR document.",
      "required": [
        "recorded",
        "validator",
        "configuration",
        "configuration_published"
      ],
      "properties": {
        "recorded": {
          "type": "string",
          "format": "date",
          "description": "The date of the last recorded full fixture run."
        },
        "validator": {
          "type": "string",
          "description": "Version of the KoSIT standalone validator used."
        },
        "configuration": {
          "type": "string",
          "description": "Version of the XRechnung validator configuration used."
        },
        "configuration_published": {
          "type": "string",
          "format": "date",
          "description": "The date that configuration was published by KoSIT."
        }
      }
    },
    "Release": {
      "type": "object",
      "description": "One released version of the rule engine.",
      "required": [
        "version",
        "date",
        "rules_added"
      ],
      "properties": {
        "version": {
          "type": "string"
        },
        "date": {
          "type": "string",
          "format": "date"
        },
        "rules_added": {
          "type": "array",
          "description": "The rule ids this release first named in the changelog. Derived, never typed — see `derivation` on the enclosing document. Empty for a release that named none.",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}