|
1352 | 1352 | ] |
1353 | 1353 | }, |
1354 | 1354 |
|
| 1355 | + "data_table_cell": { |
| 1356 | + "description": "A cell inside a data_table_block row. `raw_text` / `raw_number` for simple values, `rich_text` for formatted content. Per https://docs.slack.dev/reference/block-kit/blocks/data-table-block. The docs' per-cell schemas list `properties` without a `required` array; we mirror `table_cell` and require the value-bearing field(s). The rule 'the first (header) row cannot contain rich_text cells' is a row-position constraint JSON Schema can't express and is not enforced here.", |
| 1357 | + "oneOf": [ |
| 1358 | + { |
| 1359 | + "type": "object", |
| 1360 | + "additionalProperties": false, |
| 1361 | + "required": ["type", "text"], |
| 1362 | + "properties": { |
| 1363 | + "type": { "const": "raw_text" }, |
| 1364 | + "text": { "type": "string", "minLength": 1 } |
| 1365 | + } |
| 1366 | + }, |
| 1367 | + { |
| 1368 | + "type": "object", |
| 1369 | + "additionalProperties": false, |
| 1370 | + "required": ["type", "value"], |
| 1371 | + "properties": { |
| 1372 | + "type": { "const": "raw_number" }, |
| 1373 | + "value": { "type": "number" }, |
| 1374 | + "text": { "type": "string", "minLength": 1 } |
| 1375 | + } |
| 1376 | + }, |
| 1377 | + { |
| 1378 | + "type": "object", |
| 1379 | + "additionalProperties": false, |
| 1380 | + "required": ["type", "elements"], |
| 1381 | + "properties": { |
| 1382 | + "type": { "const": "rich_text" }, |
| 1383 | + "elements": { |
| 1384 | + "type": "array", |
| 1385 | + "items": { "$ref": "#/$defs/rich_text_container_element" } |
| 1386 | + } |
| 1387 | + } |
| 1388 | + } |
| 1389 | + ] |
| 1390 | + }, |
| 1391 | + |
| 1392 | + "data_table_block": { |
| 1393 | + "description": "Rich, interactive table with pagination, sorting, and filtering (https://docs.slack.dev/reference/block-kit/blocks/data-table-block). Distinct from `table_block`, which is a simpler static table. The single-table and aggregate 10,000-character limits are payload-level rules not enforced here. `row_header_column_index` must point at an existing column, a cross-field rule JSON Schema can't check (bounded to 0–19 since a row has at most 20 cells).", |
| 1394 | + "type": "object", |
| 1395 | + "additionalProperties": false, |
| 1396 | + "required": ["type", "caption", "rows"], |
| 1397 | + "properties": { |
| 1398 | + "type": { "const": "data_table" }, |
| 1399 | + "block_id": { "$ref": "#/$defs/block_id" }, |
| 1400 | + "caption": { "type": "string", "minLength": 1 }, |
| 1401 | + "page_size": { "type": "integer", "minimum": 1, "maximum": 100 }, |
| 1402 | + "row_header_column_index": { "type": "integer", "minimum": 0, "maximum": 19 }, |
| 1403 | + "rows": { |
| 1404 | + "description": "First row is the header; 2–101 rows total (1 header + 1–100 data rows), 1–20 cells per row.", |
| 1405 | + "type": "array", |
| 1406 | + "minItems": 2, |
| 1407 | + "maxItems": 101, |
| 1408 | + "items": { |
| 1409 | + "type": "array", |
| 1410 | + "minItems": 1, |
| 1411 | + "maxItems": 20, |
| 1412 | + "items": { "$ref": "#/$defs/data_table_cell" } |
| 1413 | + } |
| 1414 | + } |
| 1415 | + } |
| 1416 | + }, |
| 1417 | + |
1355 | 1418 | "data_visualization_block": { |
1356 | 1419 | "description": "Renders data as a line, bar, area, or pie chart. Messages only (https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block). Slack renders at most two data_visualization blocks per message (enforced via the checkDataVisualizationMax helper, since JSON Schema can't count sibling blocks). Two further runtime rules are enforced via checkDataVisualizationConsistency, since they depend on sibling-field values JSON Schema can't compare: series names must be unique within a chart, and each series must contain exactly one data point per axis_config.categories label.", |
1357 | 1420 | "type": "object", |
|
1678 | 1741 | { "$ref": "#/$defs/container_block" }, |
1679 | 1742 | { "$ref": "#/$defs/context_actions_block" }, |
1680 | 1743 | { "$ref": "#/$defs/context_block" }, |
| 1744 | + { "$ref": "#/$defs/data_table_block" }, |
1681 | 1745 | { "$ref": "#/$defs/data_visualization_block" }, |
1682 | 1746 | { "$ref": "#/$defs/divider_block" }, |
1683 | 1747 | { "$ref": "#/$defs/file_block" }, |
|
0 commit comments