{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "YAGIRO Unicode text report v1",
  "description": "Field shapes for well-formed input, preserving code points in logical order. The variationSelector flag covers U+FE00–FE0F and U+E0100–E01EF. Counts, positions and normalized lengths also require comparison with the input.",
  "type": "object",
  "required": [
    "format",
    "utf16Units",
    "codePoints",
    "flagCounts",
    "points",
    "nfc",
    "nfkc"
  ],
  "properties": {
    "format": {
      "const": "yagiro-unicode-text-report-v1"
    },
    "utf16Units": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5000
    },
    "codePoints": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5000
    },
    "flagCounts": {
      "type": "object",
      "required": [
        "whitespace",
        "mark",
        "control",
        "format",
        "bidiControl",
        "variationSelector",
        "joiner"
      ],
      "properties": {
        "whitespace": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "mark": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "control": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "format": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "bidiControl": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "variationSelector": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "joiner": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        }
      },
      "additionalProperties": false
    },
    "points": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "position",
          "utf16Offset",
          "utf16Width",
          "codePoint",
          "flags"
        ],
        "properties": {
          "position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000
          },
          "utf16Offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4999
          },
          "utf16Width": {
            "enum": [
              1,
              2
            ]
          },
          "codePoint": {
            "type": "string",
            "pattern": "^U\\+(?:[0-9A-C][0-9A-F]{3}|D[0-7][0-9A-F]{2}|[EF][0-9A-F]{3}|[1-9A-F][0-9A-F]{4}|10[0-9A-F]{4})(?![\\s\\S])"
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "whitespace",
                "mark",
                "control",
                "format",
                "bidiControl",
                "variationSelector",
                "joiner"
              ]
            },
            "maxItems": 7,
            "uniqueItems": true
          }
        },
        "additionalProperties": false
      },
      "maxItems": 5000
    },
    "nfc": {
      "type": "object",
      "required": [
        "changed",
        "utf16Units",
        "codePoints"
      ],
      "properties": {
        "changed": {
          "type": "boolean"
        },
        "utf16Units": {
          "type": "integer",
          "minimum": 0
        },
        "codePoints": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "nfkc": {
      "type": "object",
      "required": [
        "changed",
        "utf16Units",
        "codePoints"
      ],
      "properties": {
        "changed": {
          "type": "boolean"
        },
        "utf16Units": {
          "type": "integer",
          "minimum": 0
        },
        "codePoints": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
