{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Tech Dictionary term",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "term",
    "aliases",
    "category",
    "level",
    "tags",
    "definition",
    "analogy",
    "example",
    "caveat",
    "related",
    "sources"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "term": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "aliases": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "category": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "level": {
      "enum": [
        "beginner",
        "intermediate",
        "advanced"
      ]
    },
    "tags": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "definition": {
      "type": "string",
      "minLength": 10,
      "maxLength": 500
    },
    "analogy": {
      "type": "string",
      "minLength": 10,
      "maxLength": 500
    },
    "example": {
      "type": "string",
      "minLength": 10,
      "maxLength": 500
    },
    "caveat": {
      "type": "string",
      "maxLength": 500
    },
    "related": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      }
    },
    "sources": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title",
          "url"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          }
        }
      }
    }
  }
}
