{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usewrit-app/json-schema/usewrit-app-dataset-meta-schema.json",
  "title": "DatasetMeta",
  "description": "A dataset's metadata + inferred schema. A cloud crawl dataset forwarded by a linked daemon returns the cloud facets shape, which additionally carries `collections`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usewrit-app-datasets-api-openapi.yml#/components/schemas/DatasetMeta",
  "type": "object",
  "required": [
    "id",
    "name",
    "source_type",
    "columns",
    "facets",
    "row_count",
    "run_count",
    "truncated"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "name": {
      "type": "string"
    },
    "source_type": {
      "type": "string",
      "enum": [
        "crawl",
        "workflow"
      ]
    },
    "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
    },
    "collections": {
      "type": "array",
      "description": "Nested array paths (e.g. `posts.items`) you can pivot to with `collection`. Only on a FORWARDED cloud dataset — a local dataset omits this key.",
      "items": {
        "type": "string"
      }
    },
    "row_count": {
      "type": "integer"
    },
    "run_count": {
      "type": "integer",
      "description": "Runs actually scanned to build this schema."
    },
    "truncated": {
      "type": "boolean",
      "description": "The run-scan cap bounded the answer."
    }
  }
}