{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://encode.wiki/api/v1/section-schema.json",
  "title": "Encode Wiki corpus section",
  "type": "object",
  "required": [
    "schemaVersion",
    "contentVersion",
    "id",
    "documentId",
    "collection",
    "title",
    "depth",
    "canonicalUrl",
    "apiUrl",
    "markdownUrl",
    "documentApiUrl",
    "status",
    "license",
    "checksum",
    "bytes",
    "contentFormat",
    "markdown"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "contentVersion": {
      "type": "string"
    },
    "id": {
      "type": "string",
      "minLength": 1
    },
    "documentId": {
      "type": "string",
      "pattern": "^(docs|articles)/"
    },
    "collection": {
      "enum": [
        "docs",
        "articles"
      ]
    },
    "documentTitle": {
      "type": "string",
      "minLength": 1
    },
    "documentApiUrl": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "depth": {
      "type": "integer",
      "minimum": 0,
      "maximum": 6
    },
    "anchor": {
      "type": "string",
      "minLength": 1
    },
    "canonicalUrl": {
      "type": "string",
      "format": "uri"
    },
    "apiUrl": {
      "type": "string",
      "format": "uri"
    },
    "markdownUrl": {
      "type": "string",
      "format": "uri"
    },
    "status": {
      "enum": [
        "current",
        "needs-review",
        "archived"
      ]
    },
    "license": {
      "type": "string",
      "minLength": 1
    },
    "dates": {
      "type": "object"
    },
    "sources": {
      "type": "array"
    },
    "checksum": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "bytes": {
      "type": "integer",
      "minimum": 1
    },
    "contentFormat": {
      "const": "markdown"
    },
    "markdown": {
      "type": "string",
      "minLength": 1
    }
  }
}
