{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kickjolly-com/json-schema/kickjolly-com-search-result-schema.json",
  "title": "SearchResult",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kickjolly-com-openapi.yml#/components/schemas/SearchResult",
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Story"
      }
    },
    "next_page": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Page to request next, or null when there are no further pages."
    },
    "retrieved_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "results",
    "next_page",
    "retrieved_at"
  ],
  "$defs": {
    "Classification": {
      "type": "object",
      "description": "How the source was classified. Not a verification of the claim.",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "authentic",
            "reported",
            "rumour"
          ],
          "description": "authentic = official source, reported = attributed publisher reporting, rumour = speculative wording."
        },
        "label": {
          "type": "string",
          "description": "Human-readable label."
        },
        "detail": {
          "type": "string",
          "description": "What the label does and does not claim."
        }
      },
      "required": [
        "kind",
        "label",
        "detail"
      ]
    },
    "Source": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Publisher name."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Original report URL."
        }
      },
      "required": [
        "name",
        "url"
      ]
    },
    "Story": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-f0-9]{24}$"
        },
        "title": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Canonical Kickjolly story URL."
        },
        "text": {
          "type": "string",
          "description": "Short attributed brief."
        },
        "clubs": {
          "type": "array",
          "description": "Clubs tagged on this story. Tagging is automatic and may miss coverage.",
          "items": {
            "type": "string"
          }
        },
        "published_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "classification": {
          "$ref": "#/$defs/Classification"
        },
        "source": {
          "$ref": "#/$defs/Source"
        },
        "ai_written": {
          "type": "boolean",
          "description": "Whether the brief text was model-generated and review-checked."
        },
        "coverage_note": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "title",
        "url",
        "text",
        "clubs",
        "published_at",
        "updated_at",
        "classification",
        "source",
        "ai_written"
      ]
    }
  }
}