{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usewrit-app/json-schema/usewrit-app-data-facets-schema.json",
  "title": "DataFacets",
  "description": "Per-column facets (`GET /v1/workflows/{id}/data/facets`).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usewrit-app-data-api-openapi.yml#/components/schemas/DataFacets",
  "type": "object",
  "required": [
    "workflow_id",
    "columns",
    "facets",
    "row_count",
    "scanned_runs",
    "truncated"
  ],
  "properties": {
    "workflow_id": {
      "type": "integer",
      "format": "int64"
    },
    "columns": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "facets": {
      "type": "object",
      "description": "Per-column facet descriptors (inferred type, non-empty count, numeric min/max, distinct pick-list when low-cardinality).",
      "additionalProperties": true
    },
    "row_count": {
      "type": "integer"
    },
    "scanned_runs": {
      "type": "integer"
    },
    "truncated": {
      "type": "boolean"
    },
    "sources": {
      "type": "object",
      "description": "Lens views only — pre-filter source buckets.",
      "additionalProperties": {
        "type": "integer"
      }
    }
  }
}