{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "title": {
      "type": "string",
      "title": "Title"
    },
    "columns": {
      "items": {
        "$ref": "#/$defs/Column"
      },
      "type": "array",
      "maxItems": 32,
      "minItems": 1,
      "title": "Columns"
    },
    "rows": {
      "items": {
        "$ref": "#/$defs/TableRow"
      },
      "type": "array",
      "maxItems": 25000,
      "title": "Rows"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "title",
    "columns",
    "rows"
  ],
  "title": "Table",
  "$defs": {
    "Column": {
      "properties": {
        "key": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$",
          "title": "Key"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "unit": {
          "type": "string",
          "title": "Unit",
          "default": ""
        },
        "numeric": {
          "type": "boolean",
          "title": "Numeric",
          "default": false
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "key",
        "label"
      ],
      "title": "Column"
    },
    "TableRow": {
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$",
          "title": "Id"
        },
        "cells": {
          "patternProperties": {
            "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "type": "object",
          "maxProperties": 32,
          "title": "Cells"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "cells"
      ],
      "title": "TableRow"
    }
  }
}
