{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bithot-news/json-schema/bithot-news-weeklies-response-schema.json",
  "title": "WeekliesResponse",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bithot-news-openapi.json#/components/schemas/WeekliesResponse",
  "type": "object",
  "required": [
    "schemaVersion",
    "count",
    "items"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WeeklyEntry"
      }
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "description": "Machine-readable BITHOT provenance for traceability. Retain it where technically feasible. Attribution alone is not authorization; see the public terms.",
      "required": [
        "name",
        "url"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "PeriodEntry": {
      "type": "object",
      "required": [
        "periodStart",
        "periodEnd",
        "generatedAt",
        "headline",
        "links"
      ],
      "properties": {
        "periodStart": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "First calendar day the issue covers (Asia/Shanghai)."
        },
        "periodEnd": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Last calendar day the issue covers (Asia/Shanghai)."
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "headline": {
          "type": [
            "string",
            "null"
          ],
          "description": "The issue's lead: its most important item's title, or once that item is withdrawn the next one still public (older issues may carry their own headline)."
        },
        "links": {
          "type": "object",
          "required": [
            "aihot"
          ],
          "properties": {
            "aihot": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "attribution": {
          "$ref": "#/$defs/Attribution"
        }
      }
    },
    "WeeklyEntry": {
      "allOf": [
        {
          "$ref": "#/$defs/PeriodEntry"
        },
        {
          "type": "object",
          "required": [
            "week"
          ],
          "properties": {
            "week": {
              "type": "string",
              "pattern": "^\\d{4}-W\\d{2}$",
              "description": "ISO week label, e.g. 2026-W39."
            }
          }
        }
      ]
    }
  }
}