{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://emendatio.reverdin.eu/api/v1/schema/index.json",
  "title": "Emendatio API v1 Works Index",
  "type": "object",
  "required": [
    "version",
    "license",
    "works"
  ],
  "additionalProperties": false,
  "properties": {
    "version": {
      "type": "string",
      "const": "v1"
    },
    "license": {
      "type": "string"
    },
    "works": {
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "object",
        "required": [
          "id",
          "title",
          "author",
          "lang",
          "edition",
          "status",
          "license",
          "units_count",
          "corrections_count",
          "url"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "author": {
            "type": "string"
          },
          "lang": {
            "type": "string"
          },
          "edition": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "license": {
            "type": "string"
          },
          "units_count": {
            "type": "integer",
            "minimum": 1
          },
          "corrections_count": {
            "type": "integer",
            "minimum": 0
          },
          "url": {
            "type": "string"
          }
        }
      }
    }
  }
}
