{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rows-page/json-schema/rows-page-dataset-response-schema.json",
  "title": "DatasetResponse",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rows-page-openapi.json#/components/schemas/DatasetResponse",
  "type": "object",
  "properties": {
    "dataset": {
      "$ref": "#/$defs/DatasetMeta"
    },
    "version": {
      "type": "object",
      "description": "Requested (or latest) version with data_url, raw_url, locked, purged"
    },
    "versions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Newest first"
    },
    "findings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Finding"
      }
    },
    "preview": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "columns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Column"
          }
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "array"
          }
        },
        "truncated": {
          "type": "boolean"
        },
        "json_path": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "viewer": {
      "type": "object",
      "properties": {
        "is_owner": {
          "type": "boolean"
        },
        "plan": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  },
  "$defs": {
    "Column": {
      "type": "object",
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Dot path for nested fields"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "DatasetMeta": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "summary": {
          "type": [
            "string",
            "null"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "public",
            "private"
          ]
        },
        "id_column": {
          "type": [
            "string",
            "null"
          ]
        },
        "latest_version": {
          "type": "integer"
        },
        "source_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "owned": {
          "type": "boolean"
        },
        "key": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "Finding": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "version": {
          "type": [
            "integer",
            "null"
          ]
        },
        "title": {
          "type": "string"
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "view": {
          "type": "object",
          "properties": {
            "q": {
              "type": "string"
            },
            "sort": {
              "type": "string"
            },
            "cols": {
              "type": "string"
            },
            "sql": {
              "type": "string"
            }
          }
        },
        "row_count": {
          "type": [
            "integer",
            "null"
          ]
        },
        "position": {
          "type": "integer"
        },
        "created_via": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        }
      }
    }
  }
}