{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://emendatio.reverdin.eu/api/v1/schema/martini-corrections.json",
  "title": "Martini Bible All Corrections",
  "type": "object",
  "required": [
    "work",
    "total",
    "total_variants",
    "by_type",
    "corrections",
    "variants"
  ],
  "additionalProperties": false,
  "properties": {
    "work": {
      "type": "string",
      "const": "martini"
    },
    "total": {
      "type": "integer",
      "minimum": 1
    },
    "total_variants": {
      "type": "integer",
      "minimum": 0
    },
    "by_type": {
      "type": "object",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "corrections": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "book",
          "book_slug",
          "chapter",
          "verse",
          "from",
          "to",
          "type",
          "type_label",
          "page"
        ],
        "additionalProperties": false,
        "properties": {
          "book": {
            "type": "string"
          },
          "book_slug": {
            "type": "string"
          },
          "chapter": {
            "type": "integer",
            "minimum": 1
          },
          "verse": {
            "type": "integer",
            "minimum": 1
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "lettre",
              "accent",
              "soudure",
              "coupure",
              "omission",
              "ajout",
              "autre"
            ]
          },
          "type_label": {
            "type": "object",
            "required": [
              "it",
              "fr",
              "en",
              "de",
              "es",
              "pl",
              "pt"
            ],
            "additionalProperties": false,
            "properties": {
              "it": {
                "type": "string",
                "minLength": 1
              },
              "fr": {
                "type": "string",
                "minLength": 1
              },
              "en": {
                "type": "string",
                "minLength": 1
              },
              "de": {
                "type": "string",
                "minLength": 1
              },
              "es": {
                "type": "string",
                "minLength": 1
              },
              "pl": {
                "type": "string",
                "minLength": 1
              },
              "pt": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "note": {
            "type": "string"
          },
          "page": {
            "type": "object",
            "required": [
              "index",
              "canvas",
              "iiif",
              "region",
              "image",
              "viewer"
            ],
            "additionalProperties": false,
            "properties": {
              "index": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "canvas": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "iiif": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "image": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "viewer": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "variants": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "book",
          "book_slug",
          "chapter",
          "verse",
          "ora",
          "imprime",
          "note",
          "page"
        ],
        "additionalProperties": false,
        "properties": {
          "book": {
            "type": "string"
          },
          "book_slug": {
            "type": "string"
          },
          "chapter": {
            "type": "integer",
            "minimum": 1
          },
          "verse": {
            "type": "integer",
            "minimum": 1
          },
          "ora": {
            "type": "string"
          },
          "imprime": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "page": {
            "type": "object",
            "required": [
              "index",
              "canvas",
              "iiif",
              "region",
              "image",
              "viewer"
            ],
            "additionalProperties": false,
            "properties": {
              "index": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "canvas": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "iiif": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "image": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "viewer": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    }
  }
}
