{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://emendatio.reverdin.eu/api/v1/schema/martini-chapter.json",
  "title": "Martini Bible Chapter",
  "type": "object",
  "required": [
    "work",
    "book",
    "book_slug",
    "book_name",
    "chapter",
    "verses",
    "corrections",
    "variants",
    "retranscribed",
    "source"
  ],
  "additionalProperties": false,
  "properties": {
    "work": {
      "type": "string",
      "const": "martini"
    },
    "book": {
      "type": "string"
    },
    "book_slug": {
      "type": "string"
    },
    "book_name": {
      "type": "string"
    },
    "chapter": {
      "type": "integer",
      "minimum": 1
    },
    "verses": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "n",
          "text"
        ],
        "additionalProperties": false,
        "properties": {
          "n": {
            "type": "integer",
            "minimum": 1
          },
          "text": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "corrections": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "verse",
          "from",
          "to",
          "type",
          "type_label",
          "page"
        ],
        "additionalProperties": false,
        "properties": {
          "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": [
          "verse",
          "ora",
          "imprime",
          "note",
          "page"
        ],
        "additionalProperties": false,
        "properties": {
          "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"
                ]
              }
            }
          }
        }
      }
    },
    "retranscribed": {
      "type": "boolean"
    },
    "source": {
      "type": "object",
      "required": [
        "edition",
        "erara_pdf",
        "pages",
        "license"
      ],
      "additionalProperties": false,
      "properties": {
        "edition": {
          "type": "string"
        },
        "erara_pdf": {
          "type": "integer"
        },
        "pages": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "license": {
          "type": "string"
        }
      }
    }
  }
}
