{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "SampleJsonOutput",
  "description": "JSON output for sample command",
  "type": "object",
  "properties": {
    "dialect": {
      "type": "string"
    },
    "dry_run": {
      "type": "boolean"
    },
    "input_file": {
      "type": "string"
    },
    "mode": {
      "$ref": "#/$defs/SampleModeJson"
    },
    "output_file": {
      "type": ["string", "null"]
    },
    "statistics": {
      "$ref": "#/$defs/SampleStatistics"
    },
    "tables": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TableSampleJson"
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "input_file",
    "dialect",
    "dry_run",
    "mode",
    "statistics",
    "tables"
  ],
  "$defs": {
    "SampleModeJson": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "value": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": ["type", "value"]
    },
    "SampleStatistics": {
      "type": "object",
      "properties": {
        "fk_orphans_rejected": {
          "type": "integer",
          "minimum": 0
        },
        "rows_selected": {
          "type": "integer",
          "minimum": 0
        },
        "rows_total": {
          "type": "integer",
          "minimum": 0
        },
        "sample_rate_percent": {
          "type": "number"
        },
        "tables_sampled": {
          "type": "integer",
          "minimum": 0
        },
        "tables_skipped": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "tables_sampled",
        "tables_skipped",
        "rows_selected",
        "rows_total",
        "sample_rate_percent",
        "fk_orphans_rejected"
      ]
    },
    "TableSampleJson": {
      "type": "object",
      "properties": {
        "classification": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "rows_selected": {
          "type": "integer",
          "minimum": 0
        },
        "rows_total": {
          "type": "integer",
          "minimum": 0
        },
        "sample_rate_percent": {
          "type": "number"
        }
      },
      "required": [
        "name",
        "classification",
        "rows_selected",
        "rows_total",
        "sample_rate_percent"
      ]
    }
  }
}
