{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ax0s.io/data/claims-public.schema.json",
  "title": "Ax0s public claim registry",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "claims"],
  "properties": {
    "schema_version": { "const": 1 },
    "claims": {
      "type": "array",
      "items": { "$ref": "#/$defs/claim" }
    }
  },
  "$defs": {
    "claim": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "claim",
        "status",
        "scope",
        "source_or_method_url",
        "artifact_links",
        "checked_date",
        "review_or_expiry_date",
        "limitation",
        "public_owner_role",
        "allowed_public_surfaces",
        "supersedes",
        "superseded_by"
      ],
      "properties": {
        "id": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
        "claim": { "type": "string", "minLength": 1 },
        "status": {
          "oneOf": [
            {
              "enum": [
                "Method published",
                "Re-run pending",
                "Internal dogfood",
                "In build",
                "Direction",
                "Experimental",
                "Roadmap",
                "Disconfirmed",
                "Superseded"
              ]
            },
            { "type": "string", "pattern": "^Verified [0-9]{4}-[0-9]{2}-[0-9]{2}$" }
          ]
        },
        "scope": { "type": "string", "minLength": 1 },
        "source_or_method_url": {
          "oneOf": [
            { "type": "null" },
            { "type": "string", "pattern": "^(?:/|https://)" }
          ]
        },
        "artifact_links": {
          "type": "array",
          "items": { "type": "string", "pattern": "^(?:/|https://)" },
          "uniqueItems": true
        },
        "checked_date": {
          "oneOf": [
            { "type": "null" },
            { "type": "string", "format": "date" }
          ]
        },
        "review_or_expiry_date": {
          "oneOf": [
            { "type": "null" },
            { "type": "string", "format": "date" }
          ]
        },
        "limitation": { "type": "string", "minLength": 1 },
        "public_owner_role": {
          "oneOf": [
            { "type": "null" },
            { "type": "string", "minLength": 1 }
          ]
        },
        "allowed_public_surfaces": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string", "pattern": "^/" },
          "uniqueItems": true
        },
        "supersedes": {
          "oneOf": [
            { "type": "null" },
            { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }
          ]
        },
        "superseded_by": {
          "oneOf": [
            { "type": "null" },
            { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }
          ]
        }
      }
    }
  }
}
