{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "const": "v1"
    },
    "generated": {
      "type": "string"
    },
    "licence": {
      "type": "string",
      "const": "CC BY 4.0"
    },
    "licence_url": {
      "type": "string",
      "const": "https://creativecommons.org/licenses/by/4.0/"
    },
    "cite_as": {
      "type": "string",
      "const": "Scamstats (Armidale), scamstats.org"
    },
    "page_url": {
      "type": "string"
    },
    "area": {
      "type": "string"
    },
    "swept": {
      "type": [
        "string",
        "null"
      ]
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "area": {
            "type": "string"
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "publisher": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "victims_survey",
                "police_cases",
                "reports",
                "losses",
                "blocked",
                "enforcement",
                "other"
              ]
            }
          },
          "unit": {
            "type": "string"
          },
          "covers_from": {
            "type": "string"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "annual",
              "quarterly",
              "monthly",
              "one_off",
              "irregular"
            ]
          },
          "editions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source_id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "published": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "archive_url": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "source_id",
                "title",
                "published",
                "url",
                "archive_url"
              ],
              "additionalProperties": false
            }
          },
          "reported_in": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "source_id": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "source_id",
                "publisher",
                "title",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "latest": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "published": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "title",
              "published",
              "url"
            ],
            "additionalProperties": false
          },
          "headline": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              },
              "period": {
                "type": "string"
              },
              "as_stated": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "unit",
              "period",
              "as_stated"
            ],
            "additionalProperties": false
          },
          "access": {
            "type": "string",
            "enum": [
              "free",
              "registration",
              "paid"
            ]
          },
          "terms": {
            "type": "string"
          },
          "not_used_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "found_via": {
            "anyOf": [
              {
                "type": "string",
                "const": "Commsrisk"
              },
              {
                "type": "null"
              }
            ]
          },
          "checked": {
            "type": "string"
          },
          "use": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "figures",
                  "quoted",
                  "not_used"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "use_label": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "area",
          "region",
          "publisher",
          "title",
          "url",
          "measures",
          "unit",
          "covers_from",
          "frequency",
          "editions",
          "reported_in",
          "latest",
          "headline",
          "access",
          "terms",
          "not_used_reason",
          "found_via",
          "checked",
          "use",
          "use_label"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "version",
    "generated",
    "licence",
    "licence_url",
    "cite_as",
    "page_url",
    "area",
    "swept",
    "entries"
  ],
  "additionalProperties": false
}
