{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "YAGIRO exact row partition report v1",
  "description": "Structural validation only. Application-level checks must verify selected column against header width, equal row widths, rows/sourceRecords correspondence, source range, within-group order, disjoint and complete coverage and exact matching against the original input. String-length limits use UTF-16 code units in the application and are not modeled by JSON Schema maxLength.",
  "type": "object",
  "required": [
    "format",
    "sourceDelimiter",
    "comparison",
    "headerRecord",
    "firstDataRecord",
    "columns",
    "selectedColumn",
    "exactValue",
    "inputDataRecords",
    "matching",
    "remaining"
  ],
  "additionalProperties": false,
  "properties": {
    "format": {
      "const": "yagiro-row-partition-v1"
    },
    "sourceDelimiter": {
      "enum": [
        "comma",
        "tab",
        "semicolon"
      ]
    },
    "comparison": {
      "const": "exact-string"
    },
    "headerRecord": {
      "const": 1
    },
    "firstDataRecord": {
      "const": 2
    },
    "columns": {
      "type": "array",
      "minItems": 1,
      "maxItems": 64,
      "items": {
        "type": "string"
      }
    },
    "selectedColumn": {
      "type": "integer",
      "minimum": 1,
      "maximum": 64
    },
    "exactValue": {
      "type": "string"
    },
    "inputDataRecords": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2000
    },
    "matching": {
      "$ref": "#/$defs/group"
    },
    "remaining": {
      "$ref": "#/$defs/group"
    }
  },
  "$defs": {
    "group": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "sourceRecords",
        "rows"
      ],
      "properties": {
        "sourceRecords": {
          "type": "array",
          "maxItems": 2000,
          "uniqueItems": true,
          "items": {
            "type": "integer",
            "minimum": 2,
            "maximum": 2001
          }
        },
        "rows": {
          "type": "array",
          "maxItems": 2000,
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 64,
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
