{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thinair-co/json-schema/thinair-co-tables-profile-response-schema.json",
  "title": "TablesProfileResponse",
  "description": "Per-column profile + health insights for one table. Mirrors the MCP `data_profile` envelope shape.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/data-thinair-co-openapi.json#/components/schemas/TablesProfileResponse",
  "type": "object",
  "properties": {
    "profiles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "nullable": {
            "type": "boolean"
          },
          "isPrimaryKey": {
            "type": "boolean"
          },
          "null_pct": {
            "type": "number"
          },
          "cardinality": {
            "type": "number"
          },
          "min": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ]
          },
          "max": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ]
          },
          "avg": {
            "type": "number"
          },
          "earliest": {
            "type": "string"
          },
          "latest": {
            "type": "string"
          },
          "pii_risk": {
            "type": "boolean"
          },
          "pii_type": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "summary": {
      "type": "string"
    },
    "insights": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "severity": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "column": {
            "type": "string"
          },
          "value": {}
        },
        "required": [
          "severity",
          "message"
        ]
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "executionTimeMs": {
          "type": "number"
        },
        "rowCount": {
          "type": "number"
        },
        "connection": {
          "type": "string"
        },
        "dialect": {
          "type": "string",
          "enum": [
            "postgres",
            "mysql",
            "mssql"
          ]
        }
      },
      "required": [
        "executionTimeMs",
        "rowCount",
        "connection",
        "dialect"
      ]
    }
  },
  "required": [
    "profiles",
    "meta"
  ]
}