{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://analysisreports.github.io/schemas/articles.schema.json",
  "title": "English Research Articles Index Schema",
  "type": "object",
  "required": ["$schema", "metadata", "articles"],
  "properties": {
    "$schema": {"const": "https://analysisreports.github.io/schemas/articles.schema.json"},
    "metadata": {
      "type": "object",
      "required": ["title", "domain", "language", "version", "author", "license", "endpoint", "text_endpoint", "documentation", "last_updated", "total_articles"],
      "properties": {
        "language": {"const": "en"},
        "last_updated": {"type": "string", "format": "date-time"},
        "total_articles": {"type": "integer", "minimum": 0}
      }
    },
    "articles": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["slug", "domain", "language", "title", "summary", "published_date", "last_updated", "canonical_web_url", "json_path", "json_url", "txt_path", "txt_url", "tags"],
        "properties": {
          "slug": {"type": "string", "minLength": 1},
          "domain": {"type": "string", "enum": ["strategic", "country", "economy", "political", "glossary"]},
          "language": {"const": "en"},
          "title": {"type": ["string", "null"]},
          "summary": {"type": ["string", "null"]},
          "published_date": {"type": ["string", "null"]},
          "last_updated": {"type": ["string", "null"]},
          "canonical_web_url": {"type": "string", "format": "uri"},
          "author_editions": {
            "type": ["object", "null"],
            "properties": {
              "tr": {"type": ["string", "null"], "format": "uri"},
              "en": {"type": ["string", "null"], "format": "uri"}
            }
          },
          "json_path": {"type": "string", "pattern": "^/.+\\.json$"},
          "json_url": {"type": "string", "format": "uri"},
          "txt_path": {"type": ["string", "null"]},
          "txt_url": {"type": ["string", "null"]},
          "tags": {"type": "array", "items": {"type": "string"}}
        }
      }
    }
  }
}
