{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "JSON string-table inspection report",
  "type": "object",
  "properties": {
    "format": {
      "const": "yagiro-json-table-check-v1"
    },
    "schema": {
      "enum": [
        "records",
        "matrix"
      ]
    },
    "rows": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2000
    },
    "columns": {
      "type": "integer",
      "minimum": 0,
      "maximum": 64
    },
    "blankHeadings": {
      "type": "integer",
      "minimum": 0,
      "maximum": 64
    },
    "duplicateHeadings": {
      "type": "integer",
      "minimum": 0,
      "maximum": 63
    },
    "shortestRowWidth": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 64
        },
        {
          "type": "null"
        }
      ]
    },
    "longestRowWidth": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 64
        },
        {
          "type": "null"
        }
      ]
    },
    "nonmatchingWidthRows": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2000
    },
    "emptyCells": {
      "type": "integer",
      "minimum": 0,
      "maximum": 128000
    },
    "objectCompatible": {
      "type": "boolean"
    }
  },
  "required": [
    "format",
    "schema",
    "rows",
    "columns",
    "blankHeadings",
    "duplicateHeadings",
    "shortestRowWidth",
    "longestRowWidth",
    "nonmatchingWidthRows",
    "emptyCells",
    "objectCompatible"
  ],
  "additionalProperties": false,
  "allOf": [
    {
      "if": {
        "properties": {
          "rows": {
            "const": 0
          }
        }
      },
      "then": {
        "properties": {
          "shortestRowWidth": {
            "type": "null"
          },
          "longestRowWidth": {
            "type": "null"
          },
          "nonmatchingWidthRows": {
            "const": 0
          },
          "emptyCells": {
            "const": 0
          }
        }
      },
      "else": {
        "properties": {
          "shortestRowWidth": {
            "type": "integer"
          },
          "longestRowWidth": {
            "type": "integer"
          },
          "columns": {
            "minimum": 1
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "schema": {
            "const": "records"
          }
        }
      },
      "then": {
        "properties": {
          "blankHeadings": {
            "const": 0
          },
          "duplicateHeadings": {
            "const": 0
          },
          "nonmatchingWidthRows": {
            "const": 0
          },
          "objectCompatible": {
            "const": true
          }
        },
        "if": {
          "properties": {
            "rows": {
              "const": 0
            }
          }
        },
        "then": {
          "properties": {
            "columns": {
              "const": 0
            }
          }
        }
      },
      "else": {
        "properties": {
          "columns": {
            "minimum": 1
          }
        }
      }
    }
  ]
}
