{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://emendatio.reverdin.eu/api/v1/schema/bible-corrections.json",
  "title": "bible-corrections",
  "type": "object",
  "required": [
    "work",
    "total",
    "total_variants",
    "corrections",
    "variants"
  ],
  "additionalProperties": false,
  "properties": {
    "work": {
      "type": "string"
    },
    "total": {
      "type": "integer",
      "minimum": 0
    },
    "total_variants": {
      "type": "integer",
      "minimum": 0
    },
    "corrections": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "verse",
          "from",
          "to",
          "type",
          "book",
          "chapter"
        ],
        "properties": {
          "verse": {
            "type": [
              "integer",
              "string"
            ]
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "page": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "leaf": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "book": {
            "type": "string",
            "pattern": "^[A-Z0-9]{3}$"
          },
          "chapter": {
            "type": "integer",
            "minimum": 1
          }
        }
      }
    },
    "variants": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "verse",
          "from",
          "to",
          "type",
          "book",
          "chapter"
        ],
        "properties": {
          "verse": {
            "type": [
              "integer",
              "string"
            ]
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "page": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "leaf": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "book": {
            "type": "string",
            "pattern": "^[A-Z0-9]{3}$"
          },
          "chapter": {
            "type": "integer",
            "minimum": 1
          }
        }
      }
    }
  }
}
