{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "YAGIRO key normalization report v1",
  "description": "Field shapes for the selected operation. Replay against the input to verify counts, row order, literal values and collision membership.",
  "type": "object",
  "required": [
    "format",
    "operation",
    "rows",
    "changedRows",
    "emptyBefore",
    "emptyAfter",
    "distinctBefore",
    "distinctAfter",
    "preexistingDuplicateGroups",
    "outputDuplicateGroups",
    "newCollisionGroups",
    "items",
    "preexistingGroups",
    "outputGroups"
  ],
  "properties": {
    "format": {
      "const": "yagiro-key-normalization-report-v1"
    },
    "operation": {
      "enum": [
        "none",
        "trim",
        "nfc",
        "nfkc",
        "lowercase"
      ]
    },
    "rows": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    },
    "changedRows": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    },
    "emptyBefore": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    },
    "emptyAfter": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    },
    "distinctBefore": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    },
    "distinctAfter": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000
    },
    "preexistingDuplicateGroups": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500
    },
    "outputDuplicateGroups": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500
    },
    "newCollisionGroups": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "row",
          "beforeJson",
          "afterJson",
          "changed"
        ],
        "properties": {
          "row": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "beforeJson": {
            "type": "string",
            "pattern": "^\"(?:[\\x20\\x21\\x23-\\x5b\\x5d-\\x7e]|\\\\(?:[\"\\\\bfnrt]|u[0-9a-f]{4}))*\"(?![\\s\\S])"
          },
          "afterJson": {
            "type": "string",
            "pattern": "^\"(?:[\\x20\\x21\\x23-\\x5b\\x5d-\\x7e]|\\\\(?:[\"\\\\bfnrt]|u[0-9a-f]{4}))*\"(?![\\s\\S])"
          },
          "changed": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "maxItems": 1000
    },
    "preexistingGroups": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "maxItems": 1000,
            "minItems": 2,
            "uniqueItems": true
          }
        },
        "additionalProperties": false
      },
      "maxItems": 500
    },
    "outputGroups": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "rows",
          "distinctOriginals",
          "newCollision"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "maxItems": 1000,
            "minItems": 2,
            "uniqueItems": true
          },
          "distinctOriginals": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "newCollision": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "maxItems": 500
    }
  },
  "additionalProperties": false
}
