{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Axmo model.yaml",
  "description": "The shape of an Axmo model.yaml (the document inside a .axmo container), generated from the format's definition (the zod/mini codecs the importer runs). It judges SHAPE ONLY: the keys of each level, unknown keys where a level is closed, the allowed values the importer enforces, the keys that are always required, and a key written empty (null or \"\"), which is refused wherever the format gives an empty value no meaning — a key is stated with a value or omitted, and omitted it takes its default (each key's description says where empty means something). An axis block has exactly one kind key, and the keys of its kind. Of the categorical tree grammar it judges the leaf rule — the value under an element is nothing (a leaf), a list of child names or a mapping of children (treeNode) — and that a dimension has at least one layer. A document it refuses will not import; a document it accepts may still be refused by the importer, which also judges what this schema does not: the rest of the tree grammar (depth against layers, Layer/Element prefixes, an element repeated in another place), series-run grouping (one series group, at the start or the end of an axis) and series placement (on exactly one axis of an output range), the alias identifier rule inside a series reference, conditional requirements (a formula for a calculated series, a driver for PROPORTIONAL, end or duration for a time dimension), value types (a type is stated only where the importer refuses another: a level that must be a mapping, and an allowed-value list), what a sequential dimension's parameters mean (the SDT definition's validator: level order, an end after its start), and everything the Dimension constructor decides (reserved characters, uniqueness, parent above child). Every reference — a binding's dimension, a weight or driver series, a loader's and a dimension generator's data source and target, a loader's mapped and fixed dimensions, an axis block's dimension and layer, an axis definition, a formula's names — is the model's meaning, judged by the compile after import and not by the importer (a name the model does not have leaves the object that names it out, with a definition error). Retired keys are admitted, as the importer admits them; each says what the importer does with it.",
  "$comment": "Generated by `npm run gen:format-schema` from src/engine/yaml/format-dictionary.ts and, for the levels converted to zod/mini, src/engine/yaml/format-leaves.ts — do not edit. Payload version 1.0. Checked in CI by `npm run check:format-schema` (Ajv, over the corpus and the known-bad set).",
  "$ref": "#/$defs/root",
  "$defs": {
    "root": {
      "title": "Top level",
      "description": "The document. Persistence §2, §2.1.",
      "type": "object",
      "properties": {
        "axmo": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Quoted: an unquoted 1.0 is a number and is refused.",
          "const": "1.0"
        },
        "name": {
          "default": "Imported Model",
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: \"Imported Model\". Always written."
        },
        "description": {
          "default": "",
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: \"\". Written when non-empty; a non-string reads as empty."
        },
        "exportedAt": {
          "default": null,
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: null. Always written, quoted ISO 8601. A non-string (an unquoted timestamp) reads as null."
        },
        "settings": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Written only when a setting is not at its default.",
          "$ref": "#/$defs/settings"
        },
        "dimensions": {
          "not": {
            "const": ""
          },
          "description": "Default: no dimensions. Written empty: no entries. Always written. Name-keyed.",
          "additionalProperties": {
            "$ref": "#/$defs/dimension",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "series": {
          "not": {
            "const": ""
          },
          "description": "Default: no series. Written empty: no entries. Always written. Name-keyed; read-only (system) series are not written.",
          "additionalProperties": {
            "$ref": "#/$defs/series",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "dataSources": {
          "not": {
            "const": ""
          },
          "description": "Written empty: no entries. Name-keyed. Not written at the definition level or when empty.",
          "additionalProperties": {
            "$ref": "#/$defs/dataSource",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "dataLoaders": {
          "not": {
            "const": ""
          },
          "description": "Written empty: no entries. Name-keyed. Not written at the definition level or when empty.",
          "additionalProperties": {
            "$ref": "#/$defs/dataLoader",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "axisDefinitions": {
          "not": {
            "const": ""
          },
          "description": "Written empty: no entries. Name-keyed. Not written at the definition level or when empty.",
          "additionalProperties": {
            "$ref": "#/$defs/axisDefinition",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "outputRanges": {
          "not": {
            "const": ""
          },
          "description": "Written empty: no entries. Name-keyed. Not written at the definition level or when empty.",
          "additionalProperties": {
            "$ref": "#/$defs/outputRange",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "data": {
          "not": {
            "const": ""
          },
          "description": "Written empty: no entries. Address-keyed; complete level only. Export-only sidecar, not part of the definition.",
          "additionalProperties": {
            "$ref": "#/$defs/dataRectangle",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "namedStructures": {
          "not": {
            "const": ""
          },
          "description": "Written empty: no entries. Name-keyed; complete level only. Export-only sidecar, not part of the definition.",
          "additionalProperties": {
            "$ref": "#/$defs/namedStructure",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        }
      },
      "required": [
        "axmo"
      ],
      "additionalProperties": false
    },
    "settings": {
      "title": "Model settings",
      "description": "settings. Persistence §2.1.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "allowCyclicProgressiveDataLoad": {
              "default": false,
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Values: true, false. Default: false. Written only when true; only the literal true is read as true."
            }
          },
          "additionalProperties": false
        },
        {
          "not": {
            "type": "object"
          }
        }
      ]
    },
    "dimension": {
      "title": "Dimension",
      "description": "dimensions.<name>. Persistence §3.1, §3.2. Open: The keys of its variant, chosen by type: a categorical or a sequential dimension.",
      "type": "object",
      "properties": {
        "type": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Exact spelling; it decides which keys the rest of the mapping has.",
          "enum": [
            "categorical",
            "sequential"
          ]
        }
      },
      "required": [
        "type"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "categorical"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/categoricalDimension"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "sequential"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/sequentialDimension"
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "categoricalDimension": {
      "title": "Categorical dimension",
      "description": "dimensions.<name> (type: categorical). Persistence §3.1.",
      "type": "object",
      "properties": {
        "layers": {
          "type": "array",
          "minItems": 1,
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a non-empty list of layer names, top to bottom."
        },
        "tree": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/treeNode"
          },
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a map of element names, each holding nothing (a leaf), a list of child names or a map of children (the tree grammar, §3.1). {} means no elements."
        }
      },
      "required": [
        "layers",
        "tree"
      ]
    },
    "sequentialDimension": {
      "title": "Sequential dimension",
      "description": "dimensions.<name> (type: sequential). Persistence §3.2, §3.2.1.",
      "type": "object",
      "properties": {
        "sequentialType": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Any other value is refused.",
          "const": "axmo_time"
        },
        "parameters": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a map of the type's parameters (the SDT definition)."
        }
      },
      "required": [
        "sequentialType",
        "parameters"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "sequentialType": {
                "const": "axmo_time"
              }
            },
            "required": [
              "sequentialType"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "$ref": "#/$defs/timeParameters"
              }
            }
          }
        }
      ]
    },
    "timeParameters": {
      "title": "axmo_time parameters",
      "description": "dimensions.<name>.parameters (sequentialType: axmo_time). Persistence §3.2.1, §3.2.4.",
      "type": "object",
      "properties": {
        "selected_levels": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required unless the legacy levels is present. Values: a non-empty list of levels, each one of \"day\", \"month\", \"quarter\", \"half_year\", \"year\" (in any letter case). Declared by AXMO_TIME_DEF (\"Layers\"). The layers, root first, with their elements' names, for a dimension named Time from 2027-06-30 to 2027-07-01 with every level: Top_Time (All_Time); Year (2027); Half-Year (2027-H1, 2027-H2); Quarter (2027-Q2, 2027-Q3); Month (2027-06, 2027-07); Day (2027-06-30, 2027-07-01). A level not selected has no layer; the root layer and its one element are always there, named after the dimension."
        },
        "start": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: the type of selected_levels[0]. Default: {{ is_set('selected_levels') ? current_period(selected_levels[0] === 'day' ? 'date' : selected_levels[0]) : null }}. Declared by AXMO_TIME_DEF (\"Start\")."
        },
        "end_mode": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: end_point. Declared by AXMO_TIME_DEF (\"End defined by\").",
          "enum": [
            "end_point",
            "duration"
          ]
        },
        "end": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required one of end / duration. Values: the type of selected_levels[0]. Declared by AXMO_TIME_DEF (\"End\")."
        },
        "duration": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required one of end / duration. Values: integer_with_unit. Declared by AXMO_TIME_DEF (\"Duration\").",
          "$ref": "#/$defs/duration"
        },
        "hasBefore": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: boolean. Default: false. Declared by AXMO_TIME_DEF (\"Opening element (BEFORE)\")."
        },
        "hasAfter": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: boolean. Default: false. Declared by AXMO_TIME_DEF (\"Closing element (AFTER)\")."
        },
        "levels": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Read only — never written. Values: coarsest-first level names, e.g. [Year, Quarter, Month]. The legacy v1 spelling of selected_levels; read only when selected_levels is absent."
        }
      },
      "required": [
        "start"
      ],
      "additionalProperties": false
    },
    "duration": {
      "title": "Duration value",
      "description": "dimensions.<name>.parameters.duration. Persistence §3.2.1, §3.2.3.",
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "object",
          "properties": {
            "value": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Values: an integer, at least 1."
            },
            "unit": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Values: one of the selected levels."
            }
          },
          "required": [
            "value",
            "unit"
          ],
          "additionalProperties": false
        }
      ]
    },
    "series": {
      "title": "Series",
      "description": "series.<name>. Persistence §4, §4.1, §4.2.",
      "type": "object",
      "properties": {
        "type": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Read case-insensitively; written in lower case.",
          "type": "string",
          "pattern": "^(?:[iI][nN][pP][uU][tT]|[cC][aA][lL][cC][uU][lL][aA][tT][eE][dD])$"
        },
        "formula": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required for a calculated series. Read as text; kept on an input series too."
        },
        "description": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Written when non-empty; a non-string reads as none."
        },
        "dimensions": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "rollUp": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "rollUpFormula": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "weightSeries": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "splitDown": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "driverSeries": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "layerOverrides": {},
                            "splitNullPolicy": {}
                          },
                          "additionalProperties": false
                        },
                        {
                          "not": {}
                        },
                        {
                          "type": "string",
                          "pattern": "^(?:[sS][uU][mM]|[aA][vV][gG]|[aA][vV][gG][aA]|[mM][iI][nN]|[mM][iI][nN][aA]|[mM][aA][xX]|[mM][aA][xX][aA]|[wW][eE][iI][gG][hH][tT][eE][dD]_[aA][vV][gG]|[fF][iI][rR][sS][tT]|[lL][aA][sS][tT]|[nN][oO][nN][eE]|[fF][oO][rR][mM][uU][lL][aA])$"
                        }
                      ]
                    }
                  },
                  {
                    "not": {}
                  },
                  {
                    "not": {
                      "type": "object"
                    }
                  }
                ]
              }
            },
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "rollUp": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "rollUpFormula": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "weightSeries": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "splitDown": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "driverSeries": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "layerOverrides": {},
                      "splitNullPolicy": {}
                    },
                    "additionalProperties": false
                  },
                  {
                    "not": {}
                  },
                  {
                    "type": "string",
                    "pattern": "^(?:[sS][uU][mM]|[aA][vV][gG]|[aA][vV][gG][aA]|[mM][iI][nN]|[mM][iI][nN][aA]|[mM][aA][xX]|[mM][aA][xX][aA]|[wW][eE][iI][gG][hH][tT][eE][dD]_[aA][vV][gG]|[fF][iI][rR][sS][tT]|[lL][aA][sS][tT]|[nN][oO][nN][eE]|[fF][oO][rR][mM][uU][lL][aA])$"
                  }
                ]
              }
            },
            {
              "not": {}
            },
            {
              "not": {
                "type": [
                  "object",
                  "array"
                ]
              }
            }
          ],
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required always written; an absent (or empty) value reads as 0-D and is reported. Values: a list of names, or a list of single-key maps (a binding each); a map is read only.",
          "items": {
            "additionalProperties": {
              "$ref": "#/$defs/binding",
              "not": {
                "enum": [
                  null,
                  ""
                ]
              }
            }
          }
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    },
    "binding": {
      "title": "Binding (one dimension of a series)",
      "description": "series.<name>.dimensions[].<dimension>. Persistence §4.3, §4.4, §4.5.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "rollUp": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: SUM. Checked when the file is read, in any case (ISSUE-112); kept as written. A single-key map's value may be the method alone (Geo: AVG).",
              "type": "string",
              "pattern": "^(?:[sS][uU][mM]|[aA][vV][gG]|[aA][vV][gG][aA]|[mM][iI][nN]|[mM][iI][nN][aA]|[mM][aA][xX]|[mM][aA][xX][aA]|[wW][eE][iI][gG][hH][tT][eE][dD]_[aA][vV][gG]|[fF][iI][rR][sS][tT]|[lL][aA][sS][tT]|[nN][oO][nN][eE]|[fF][oO][rR][mM][uU][lL][aA])$"
            },
            "rollUpFormula": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Required for rollUp: FORMULA on an input series. Optional on a calculated series: without it, the series' own formula is evaluated at the total. Written only with FORMULA; read with any method."
            },
            "weightSeries": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Required for rollUp: WEIGHTED_AVG. Values: a series in the file, or a sequential dimension's weight series. Read only when rollUp is exactly WEIGHTED_AVG; otherwise dropped. Whether it names a series is judged by the compile, not on read."
            },
            "splitDown": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: NONE. Written only when not NONE; read upper-cased; any other rule is refused (ISSUE-113). An empty value reads as absent.",
              "type": "string",
              "pattern": "^(?:[pP][rR][oO][pP][oO][rR][tT][iI][oO][nN][aA][lL]|[eE][qQ][uU][aA][lL]|[cC][oO][pP][yY]|[fF][iI][rR][sS][tT]|[lL][aA][sS][tT]|[nN][oO][nN][eE])$"
            },
            "driverSeries": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Required for splitDown: PROPORTIONAL. Written only with PROPORTIONAL; read whenever splitDown is set."
            },
            "layerOverrides": {
              "description": "Retired — not part of the format. No longer supported (ADR-021)."
            },
            "splitNullPolicy": {
              "description": "Retired — not part of the format. Deleted (ADR-430)."
            }
          },
          "additionalProperties": false
        },
        {
          "not": {}
        },
        {
          "type": "string",
          "pattern": "^(?:[sS][uU][mM]|[aA][vV][gG]|[aA][vV][gG][aA]|[mM][iI][nN]|[mM][iI][nN][aA]|[mM][aA][xX]|[mM][aA][xX][aA]|[wW][eE][iI][gG][hH][tT][eE][dD]_[aA][vV][gG]|[fF][iI][rR][sS][tT]|[lL][aA][sS][tT]|[nN][oO][nN][eE]|[fF][oO][rR][mM][uU][lL][aA])$"
        }
      ]
    },
    "dataSource": {
      "title": "Data source",
      "description": "dataSources.<name>. Persistence §5.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "sourceType": {
              "default": "excel-range",
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: \"excel-range\". Not validated."
            },
            "rangeRef": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "The Input Range's current address where it has one, else the stored reference; omitted when empty."
            },
            "shape": {
              "default": "table",
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Values: scalar, vector, table. Default: \"table\". Not validated."
            },
            "range": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Read only — never written. Legacy; kept in config and used as the sheet fallback when collecting sheets."
            },
            "hasHeaders": {
              "type": "boolean",
              "enum": [
                true,
                false
              ],
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: true. Whether the range's first row holds the column names (an Excel table's header row always does)."
            },
            "addRowNumber": {
              "type": "boolean",
              "enum": [
                true,
                false
              ],
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: false. true appends a column _Row_No numbering the rows R1, R2, … in source order."
            },
            "sheetName": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "type": [
                "string",
                "number"
              ],
              "description": "The sheet a bare address is read on; a sheet rename keeps it current."
            },
            "columnLayout": {
              "type": "string",
              "enum": [
                "dataseries",
                "dimension"
              ],
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: \"dataseries\". dimension: the columns of a band hold the elements of columnsDimension — one loader reads them, mapping that dimension to _HeaderDimElement and reading _Value (or the seriesNameColumn's series)."
            },
            "columnsDimension": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "type": [
                "string",
                "number"
              ],
              "description": "With columnLayout: dimension — the dimension whose elements the band's column headers name."
            },
            "bandStartMode": {
              "type": "string",
              "enum": [
                "beginning",
                "at",
                "after"
              ],
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: \"beginning\". Where the band begins: the first column, at bandStartColumn, or after it."
            },
            "bandStartColumn": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "type": [
                "string",
                "number"
              ],
              "description": "With bandStartMode at or after."
            },
            "bandEndMode": {
              "type": "string",
              "enum": [
                "end",
                "at",
                "before"
              ],
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: \"end\". Where the band ends: the last column, at bandEndColumn, or before it (a trailing Total column)."
            },
            "bandEndColumn": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "type": [
                "string",
                "number"
              ],
              "description": "With bandEndMode at or before."
            },
            "seriesNameColumn": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "type": [
                "string",
                "number"
              ],
              "description": "The column naming each row's series; absent, the band loads one series as _Value."
            },
            "rangeType": {
              "description": "Retired — not part of the format. Dropped on read (ADR-063)."
            },
            "columns": {
              "description": "Retired — not part of the format. A header cache only the removed bindInputRange wrote; headers are read from the range."
            }
          },
          "additionalProperties": false
        },
        {
          "not": {}
        }
      ]
    },
    "dataLoader": {
      "title": "Data loader",
      "description": "dataLoaders.<name>. Persistence §6.1, §6.2. Open: The keys of its variant, chosen by type: a series loader or a dimension generator.",
      "type": "object",
      "properties": {
        "type": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Exact spelling; it decides which keys the rest of the mapping has.",
          "enum": [
            "seriesLoader",
            "dimensionGenerator"
          ]
        }
      },
      "required": [
        "type"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "seriesLoader"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/seriesLoader"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "dimensionGenerator"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/dimensionGenerator"
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "seriesLoader": {
      "title": "Series loader",
      "description": "dataLoaders.<name> (type: seriesLoader). Persistence §6.1.",
      "type": "object",
      "properties": {
        "source": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a data source in the file. A name the file does not declare leaves the object out of the model, with a definition error (ADR-441)."
        },
        "target": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required in every form but the bulk one. Values: a series in the file. Not a key of the bulk form. A name the file does not declare leaves the object out of the model, with a definition error (ADR-441)."
        },
        "loadMode": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: table. Exact spelling; it decides which keys the loader has. Any other value is refused (AGL9-17).",
          "enum": [
            "table",
            "vector",
            "scalar"
          ]
        },
        "valueColumn": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required table mode, singular form."
        },
        "duplicateHandling": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: FIRST. Table mode, singular form; always written. Not a key of any other form (ISSUE-111): a bulk loader's targets carry their own.",
          "enum": [
            "FIRST",
            "LAST",
            "AVERAGE",
            "SUM",
            "BLOCK"
          ]
        },
        "targets": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "target": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  },
                  "valueColumn": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  },
                  "duplicateHandling": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  }
                },
                "required": [
                  "target",
                  "valueColumn"
                ],
                "additionalProperties": false
              }
            },
            {
              "not": {
                "type": "array"
              }
            }
          ],
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a list of target entries (table mode only). A non-empty list makes the loader a bulk one (ADR-061).",
          "items": {
            "$ref": "#/$defs/loaderTarget"
          }
        },
        "dimensionMappings": {
          "anyOf": [
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "column": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "not": {
                      "type": "object"
                    }
                  }
                ]
              }
            },
            {
              "not": {}
            },
            {
              "not": {
                "type": "object"
              }
            }
          ],
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a map of dimension name → { column }. Table mode. A malformed entry is dropped.",
          "additionalProperties": {
            "$ref": "#/$defs/dimensionMapping",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "openDimension": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: \"\". Vector mode."
        },
        "elementSubset": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: []. Vector mode."
        },
        "ignoreEmptyValues": {
          "type": "boolean",
          "enum": [
            true,
            false
          ],
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: false. Written only when true. true: an empty source value cell is skipped with no message; a value that cannot be loaded is still reported."
        },
        "fixedCoordinates": {
          "anyOf": [
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "description": "An element name.",
                "not": {
                  "enum": [
                    null,
                    ""
                  ]
                }
              }
            },
            {
              "not": {}
            },
            {
              "not": {
                "type": "object"
              }
            }
          ],
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a map of dimension name → element name.",
          "$ref": "#/$defs/fixedCoordinates"
        }
      },
      "required": [
        "source"
      ],
      "allOf": [
        {
          "if": {
            "allOf": [
              {
                "properties": {
                  "loadMode": {
                    "const": "table"
                  }
                }
              },
              {
                "not": {
                  "required": [
                    "targets"
                  ],
                  "properties": {
                    "targets": {
                      "type": "array",
                      "minItems": 1
                    }
                  }
                }
              }
            ]
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "targets": true
                  },
                  "required": [
                    "targets"
                  ]
                },
                {
                  "properties": {
                    "openDimension": true
                  },
                  "required": [
                    "openDimension"
                  ]
                },
                {
                  "properties": {
                    "elementSubset": true
                  },
                  "required": [
                    "elementSubset"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "allOf": [
              {
                "properties": {
                  "loadMode": {
                    "const": "table"
                  }
                }
              },
              {
                "required": [
                  "targets"
                ],
                "properties": {
                  "targets": {
                    "type": "array",
                    "minItems": 1
                  }
                }
              }
            ]
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "target": true
                  },
                  "required": [
                    "target"
                  ]
                },
                {
                  "properties": {
                    "valueColumn": true
                  },
                  "required": [
                    "valueColumn"
                  ]
                },
                {
                  "properties": {
                    "duplicateHandling": true
                  },
                  "required": [
                    "duplicateHandling"
                  ]
                },
                {
                  "properties": {
                    "openDimension": true
                  },
                  "required": [
                    "openDimension"
                  ]
                },
                {
                  "properties": {
                    "elementSubset": true
                  },
                  "required": [
                    "elementSubset"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "required": [
              "loadMode"
            ],
            "properties": {
              "loadMode": {
                "const": "vector"
              }
            }
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "valueColumn": true
                  },
                  "required": [
                    "valueColumn"
                  ]
                },
                {
                  "properties": {
                    "duplicateHandling": true
                  },
                  "required": [
                    "duplicateHandling"
                  ]
                },
                {
                  "properties": {
                    "targets": true
                  },
                  "required": [
                    "targets"
                  ]
                },
                {
                  "properties": {
                    "dimensionMappings": true
                  },
                  "required": [
                    "dimensionMappings"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "required": [
              "loadMode"
            ],
            "properties": {
              "loadMode": {
                "const": "scalar"
              }
            }
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "valueColumn": true
                  },
                  "required": [
                    "valueColumn"
                  ]
                },
                {
                  "properties": {
                    "duplicateHandling": true
                  },
                  "required": [
                    "duplicateHandling"
                  ]
                },
                {
                  "properties": {
                    "targets": true
                  },
                  "required": [
                    "targets"
                  ]
                },
                {
                  "properties": {
                    "dimensionMappings": true
                  },
                  "required": [
                    "dimensionMappings"
                  ]
                },
                {
                  "properties": {
                    "openDimension": true
                  },
                  "required": [
                    "openDimension"
                  ]
                },
                {
                  "properties": {
                    "elementSubset": true
                  },
                  "required": [
                    "elementSubset"
                  ]
                }
              ]
            }
          }
        }
      ]
    },
    "loaderTarget": {
      "title": "Series loader target entry",
      "description": "dataLoaders.<name>.targets[]. Persistence §6.1.",
      "type": "object",
      "properties": {
        "target": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a series in the file. A name the file does not declare leaves the object out of the model, with a definition error (ADR-441)."
        },
        "valueColumn": {
          "not": {
            "enum": [
              null,
              ""
            ]
          }
        },
        "duplicateHandling": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: FIRST. Always written.",
          "enum": [
            "FIRST",
            "LAST",
            "AVERAGE",
            "SUM",
            "BLOCK"
          ]
        }
      },
      "required": [
        "target",
        "valueColumn"
      ],
      "additionalProperties": false
    },
    "dimensionMapping": {
      "title": "Dimension mapping",
      "description": "dataLoaders.<name>.dimensionMappings.<dimension>. Persistence §6.1.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "column": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Required for the mapping to be read (an entry without it is dropped)."
            }
          },
          "additionalProperties": false
        },
        {
          "not": {
            "type": "object"
          }
        }
      ]
    },
    "fixedCoordinates": {
      "title": "Fixed coordinates",
      "description": "dataLoaders.<name>.fixedCoordinates. Persistence §6.1. Open: Dimension name → element name: the coordinate every loaded value takes on that dimension.",
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "description": "An element name.",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        {
          "not": {}
        },
        {
          "not": {
            "type": "object"
          }
        }
      ]
    },
    "dimensionGenerator": {
      "title": "Dimension generator",
      "description": "dataLoaders.<name> (type: dimensionGenerator). Persistence §6.2.",
      "type": "object",
      "properties": {
        "source": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a data source in the file. A name the file does not declare leaves the object out of the model, with a definition error (ADR-441)."
        },
        "target": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a dimension in the file. A name the file does not declare leaves the object out of the model, with a definition error (ADR-441)."
        },
        "sourceColumn": {
          "default": "",
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: \"\". Always written."
        },
        "parentElement": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Mutually exclusive with parentColumn."
        },
        "parentColumn": {
          "not": {
            "enum": [
              null,
              ""
            ]
          }
        },
        "layerColumn": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Names each element's layer, which must lie below its parent's; without it, or where a cell is empty, the layer is the parent's + 1."
        }
      },
      "required": [
        "source",
        "target"
      ]
    },
    "axisDefinition": {
      "title": "Axis definition",
      "description": "axisDefinitions.<name>. Persistence §7.",
      "type": "object",
      "properties": {
        "blocks": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "series": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  },
                  "dimension": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  },
                  "dimensionAll": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  },
                  "axisDef": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  },
                  "format": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  },
                  "newLine": {
                    "not": {
                      "enum": [
                        null,
                        ""
                      ]
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            {
              "not": {
                "type": "array"
              }
            }
          ],
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a list of blocks.",
          "items": {
            "$ref": "#/$defs/axisBlock"
          }
        }
      },
      "required": [
        "blocks"
      ],
      "additionalProperties": false
    },
    "axisBlock": {
      "title": "Axis block",
      "description": "axisDefinitions.<name>.blocks[] / outputRanges.<name>.rowDef|colDef.blocks[]. Persistence §7, §7.1.",
      "type": "object",
      "properties": {
        "series": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required one kind key per block. Values: one series reference: [alias := ] expression; a list is read only."
        },
        "dimension": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required one kind key per block. Values: Dimension/Layer, or a bare Dimension."
        },
        "dimensionAll": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required one kind key per block. Values: a dimension name. Every layer of the dimension as one block, coarsest first: each total comes before its members, on either axis. On a sequential dimension BEFORE is the first element and AFTER the last; neither counts in a total."
        },
        "axisDef": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required one kind key per block. Values: an axis definition's name."
        },
        "format": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: an Excel number format string. Series blocks only."
        },
        "newLine": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: false. Written only when true; read as a truth value. Not a key of an axisDef block."
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "required": [
                "series"
              ],
              "properties": {
                "series": true
              }
            },
            {
              "required": [
                "dimension"
              ],
              "properties": {
                "dimension": true
              }
            },
            {
              "required": [
                "dimensionAll"
              ],
              "properties": {
                "dimensionAll": true
              }
            },
            {
              "required": [
                "axisDef"
              ],
              "properties": {
                "axisDef": true
              }
            }
          ]
        },
        {
          "if": {
            "required": [
              "series"
            ],
            "properties": {
              "series": true
            }
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "dimension": true
                  },
                  "required": [
                    "dimension"
                  ]
                },
                {
                  "properties": {
                    "dimensionAll": true
                  },
                  "required": [
                    "dimensionAll"
                  ]
                },
                {
                  "properties": {
                    "axisDef": true
                  },
                  "required": [
                    "axisDef"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "required": [
              "dimension"
            ],
            "properties": {
              "dimension": true
            }
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "series": true
                  },
                  "required": [
                    "series"
                  ]
                },
                {
                  "properties": {
                    "dimensionAll": true
                  },
                  "required": [
                    "dimensionAll"
                  ]
                },
                {
                  "properties": {
                    "axisDef": true
                  },
                  "required": [
                    "axisDef"
                  ]
                },
                {
                  "properties": {
                    "format": true
                  },
                  "required": [
                    "format"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "required": [
              "dimensionAll"
            ],
            "properties": {
              "dimensionAll": true
            }
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "series": true
                  },
                  "required": [
                    "series"
                  ]
                },
                {
                  "properties": {
                    "dimension": true
                  },
                  "required": [
                    "dimension"
                  ]
                },
                {
                  "properties": {
                    "axisDef": true
                  },
                  "required": [
                    "axisDef"
                  ]
                },
                {
                  "properties": {
                    "format": true
                  },
                  "required": [
                    "format"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "required": [
              "axisDef"
            ],
            "properties": {
              "axisDef": true
            }
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "series": true
                  },
                  "required": [
                    "series"
                  ]
                },
                {
                  "properties": {
                    "dimension": true
                  },
                  "required": [
                    "dimension"
                  ]
                },
                {
                  "properties": {
                    "dimensionAll": true
                  },
                  "required": [
                    "dimensionAll"
                  ]
                },
                {
                  "properties": {
                    "format": true
                  },
                  "required": [
                    "format"
                  ]
                },
                {
                  "properties": {
                    "newLine": true
                  },
                  "required": [
                    "newLine"
                  ]
                }
              ]
            }
          }
        }
      ]
    },
    "outputRange": {
      "title": "Output range",
      "description": "outputRanges.<name>. Persistence §8.",
      "type": "object",
      "properties": {
        "cell": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a sheet-qualified anchor. Update does not create the sheet: it must exist when Update writes the range (an Import creates the sheets a file names; apply warns, APPLY_OUTPUT_SHEET_NOT_IN_WORKBOOK)."
        },
        "rowDef": {
          "not": {
            "const": ""
          },
          "description": "Values: { blocks: [...] }. Default: an empty axis. Written empty: an empty axis.",
          "$ref": "#/$defs/axisReference"
        },
        "colDef": {
          "not": {
            "const": ""
          },
          "description": "Values: { blocks: [...] }. Default: an empty axis. Written empty: an empty axis.",
          "$ref": "#/$defs/axisReference"
        },
        "showColumnHeaders": {
          "default": true,
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: true. Written only when false."
        },
        "showRowLabels": {
          "default": true,
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: true. Written only when false."
        },
        "showData": {
          "default": true,
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: true. Written only when false."
        },
        "internalSeries": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a map of name → inner series.",
          "additionalProperties": {
            "$ref": "#/$defs/internalSeries",
            "not": {
              "enum": [
                null,
                ""
              ]
            }
          }
        },
        "dropSet": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a map of dimension name → element names. Each listed element is dropped with its whole subtree: it and every element below it emit no row or column. A model series keeps the model's totals (a surviving total still counts what was dropped); an inner series' totals are over the surviving elements only.",
          "$ref": "#/$defs/dropSet"
        },
        "allowOverwriteExistingData": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: false. Written only when true."
        },
        "exportUserColumns": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: false. Written only when true."
        },
        "userColumns": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a list of user-column entries. Transport only.",
          "items": {
            "$ref": "#/$defs/userColumn"
          }
        },
        "outputMode": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: report, table. Default: report. Written only as table; any other value reads as report."
        },
        "tableOptions": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "$ref": "#/$defs/tableOptions"
        },
        "renderState": {
          "description": "Retired — not part of the format. Workbook-only; never written, ignored on read."
        },
        "valueDef": {
          "description": "Retired — not part of the format. Not part of the format; ignored on read."
        }
      },
      "required": [
        "cell"
      ],
      "additionalProperties": false
    },
    "axisReference": {
      "title": "Output range axis (rowDef / colDef)",
      "description": "outputRanges.<name>.rowDef | colDef. Persistence §8.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "blocks": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "series": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "dimension": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "dimensionAll": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "axisDef": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "format": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "newLine": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                {
                  "not": {
                    "type": "array"
                  }
                }
              ],
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Required unless the axis is written empty ({}). Values: a list of blocks (§7).",
              "items": {
                "$ref": "#/$defs/axisBlock"
              }
            },
            "axis": {
              "description": "Retired — not part of the format. The retired whole-axis form (ADR-038); reference an axis definition with an axisDef block."
            }
          },
          "additionalProperties": false
        },
        {
          "not": {}
        },
        {
          "not": {
            "type": "object"
          }
        }
      ]
    },
    "dropSet": {
      "title": "Drop set",
      "description": "outputRanges.<name>.dropSet. Persistence §8. Open: Dimension name → the element names dropped from it, a list (each drops its whole subtree).",
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "array",
            "items": {
              "description": "An element name, read as text."
            }
          }
        },
        {
          "not": {}
        },
        {
          "not": {
            "type": "object"
          }
        }
      ]
    },
    "internalSeries": {
      "title": "Inner series",
      "description": "outputRanges.<name>.internalSeries.<name>. Persistence §8.",
      "type": "object",
      "properties": {
        "type": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: CALCULATED, INPUT. Default: CALCULATED. Written upper-case; exactly INPUT reads as input, anything else as CALCULATED."
        },
        "expression": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required unless the legacy formula is written. A blank expression is refused."
        },
        "formula": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Read only — never written. Legacy spelling of expression, read when expression is absent."
        },
        "description": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Written when non-empty."
        },
        "dimensions": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "rollUp": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "rollUpFormula": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "weightSeries": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "splitDown": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "driverSeries": {
                              "not": {
                                "enum": [
                                  null,
                                  ""
                                ]
                              }
                            },
                            "layerOverrides": {},
                            "splitNullPolicy": {}
                          },
                          "additionalProperties": false
                        },
                        {
                          "not": {}
                        },
                        {
                          "type": "string",
                          "pattern": "^(?:[sS][uU][mM]|[aA][vV][gG]|[aA][vV][gG][aA]|[mM][iI][nN]|[mM][iI][nN][aA]|[mM][aA][xX]|[mM][aA][xX][aA]|[wW][eE][iI][gG][hH][tT][eE][dD]_[aA][vV][gG]|[fF][iI][rR][sS][tT]|[lL][aA][sS][tT]|[nN][oO][nN][eE]|[fF][oO][rR][mM][uU][lL][aA])$"
                        }
                      ]
                    }
                  },
                  {
                    "not": {}
                  },
                  {
                    "not": {
                      "type": "object"
                    }
                  }
                ]
              }
            },
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "rollUp": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "rollUpFormula": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "weightSeries": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "splitDown": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "driverSeries": {
                        "not": {
                          "enum": [
                            null,
                            ""
                          ]
                        }
                      },
                      "layerOverrides": {},
                      "splitNullPolicy": {}
                    },
                    "additionalProperties": false
                  },
                  {
                    "not": {}
                  },
                  {
                    "type": "string",
                    "pattern": "^(?:[sS][uU][mM]|[aA][vV][gG]|[aA][vV][gG][aA]|[mM][iI][nN]|[mM][iI][nN][aA]|[mM][aA][xX]|[mM][aA][xX][aA]|[wW][eE][iI][gG][hH][tT][eE][dD]_[aA][vV][gG]|[fF][iI][rR][sS][tT]|[lL][aA][sS][tT]|[nN][oO][nN][eE]|[fF][oO][rR][mM][uU][lL][aA])$"
                  }
                ]
              }
            },
            {
              "not": {}
            },
            {
              "not": {
                "type": [
                  "object",
                  "array"
                ]
              }
            }
          ],
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: as a series' dimensions. Default: 0-D. Written when non-empty. Its references are judged when the output range is compiled."
        }
      },
      "additionalProperties": false
    },
    "userColumn": {
      "title": "User column entry",
      "description": "outputRanges.<name>.userColumns[]. Persistence §8.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "name": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Required for the column to be replayed (an entry without it is skipped). Values: a string."
            },
            "index": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Required for the column to be replayed (an entry without it is skipped). Values: a finite number."
            },
            "formula": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Required for the column to be replayed (an entry without it is skipped). Values: a string."
            },
            "numberFormat": {
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Carried when a string."
            }
          },
          "additionalProperties": false
        },
        {
          "not": {
            "type": "object"
          }
        }
      ]
    },
    "tableOptions": {
      "title": "Table options",
      "description": "outputRanges.<name>.tableOptions. Persistence §8.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "includeNonLeafs": {
              "default": false,
              "not": {
                "enum": [
                  null,
                  ""
                ]
              },
              "description": "Default: false. Written only when true."
            }
          },
          "additionalProperties": false
        },
        {
          "not": {
            "type": "object"
          }
        }
      ]
    },
    "dataRectangle": {
      "title": "Data rectangle",
      "description": "data.<address>. Persistence §9.1, §9.3.",
      "type": "object",
      "properties": {
        "values": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Values: a two-dimensional list of cells (values: [[...], ...]); the legacy pre-ADR-064 shapes (columns / rows / value, or a one-dimensional values list) are no longer read — re-export the model."
        },
        "columns": {
          "description": "Retired — not part of the format. The pre-ADR-064 shape."
        },
        "rows": {
          "description": "Retired — not part of the format. The pre-ADR-064 shape."
        },
        "value": {
          "description": "Retired — not part of the format. The pre-ADR-064 shape."
        }
      },
      "required": [
        "values"
      ],
      "additionalProperties": false
    },
    "namedStructure": {
      "title": "Named structure",
      "description": "namedStructures.<name>. Persistence §9.1, §9.2.",
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "table",
            "namedRange"
          ],
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Any other value is a parse error."
        },
        "range": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required for a table."
        },
        "hasHeaders": {
          "default": true,
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Default: true. Tables."
        },
        "definition": {
          "not": {
            "enum": [
              null,
              ""
            ]
          },
          "description": "Required for a named range."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false
    },
    "treeNode": {
      "title": "Tree node",
      "description": "The value under an element of a categorical dimension's tree (Persistence §3.1): nothing (a leaf), or a list of child element names, or a mapping of child elements. Any other value is refused, by the importer too.",
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "array"
        },
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/treeNode"
          }
        }
      ]
    }
  }
}
