{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://drole.com/data/source-register-schema.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "version",
    "review_date",
    "scope",
    "source_count",
    "sources"
  ],
  "properties": {
    "$schema": {
      "const": "https://drole.com/data/source-register-schema.json"
    },
    "version": {
      "type": "string"
    },
    "review_date": {
      "type": "string",
      "format": "date"
    },
    "scope": {
      "type": "string",
      "minLength": 80
    },
    "source_count": {
      "type": "integer",
      "minimum": 1
    },
    "sources": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "url",
          "claim_scope",
          "referenced_on_pages",
          "referenced_content_ids",
          "reviewed_on",
          "endorsement"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "claim_scope": {
            "type": "string",
            "minLength": 20
          },
          "referenced_on_pages": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "referenced_content_ids": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{3}-[0-9]{4}$"
            }
          },
          "reviewed_on": {
            "type": "string",
            "format": "date"
          },
          "endorsement": {
            "const": false
          }
        }
      }
    }
  }
}
