{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mobilitydata/json-schema/mobilitydata-parquet-dataset-state-schema.json",
  "title": "ParquetDatasetState",
  "description": "Where a dataset's Parquet rendering stands. Which fields are set depends on `status`: `base_url` for `ready`, the progress fields for `preparing`, `message` for `failed`, and nothing beyond the identifiers for `absent`. What the dataset contains - its tables, their row and column counts, and what each weighed before and after conversion - is read from `{base_url}/manifest.json`, which is the one place that answer lives. The progress fields are named as the GTFS Garage viewer names its own load reports, so a client can pass them straight through.",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/operationsapi.yaml#/components/schemas/ParquetDatasetState",
  "x-operation": true,
  "type": "object",
  "required": [
    "status",
    "feed_stable_id"
  ],
  "properties": {
    "status": {
      "description": "`absent` when no conversion has ever been requested - an ordinary starting state, not an error. `preparing` while one is queued or running, `ready` once the files are published, `failed` when the last attempt did not finish.",
      "type": "string",
      "enum": [
        "absent",
        "preparing",
        "ready",
        "failed"
      ]
    },
    "feed_stable_id": {
      "description": "The stable ID of the feed the dataset belongs to.",
      "type": "string"
    },
    "dataset_stable_id": {
      "description": "The stable ID of the dataset. When the request addressed a feed, this is the feed's latest dataset, resolved at request time.",
      "type": [
        "string",
        "null"
      ]
    },
    "base_url": {
      "description": "Public URL prefix the Parquet files are served from, without a trailing slash. `{base_url}/manifest.json` is the dataset's description of itself - which tables exist, their row and column counts, and what each weighed before and after conversion - and each table is `{base_url}/{name}.parquet`. Null unless `status` is `ready`. The files are public and answer HTTP range requests; no query string is ever appended, so this can be used verbatim as a client's base URL. This response deliberately does not repeat the table list: a reader given one skips the manifest, and with it the sizes it carries.",
      "type": [
        "string",
        "null"
      ],
      "format": "url"
    },
    "phase": {
      "description": "The step currently running, in the order they happen: `download` fetches the dataset archive, `extract` unpacks it, `convert` rewrites each table as Parquet, `upload` publishes the results, `summarise` records the manifest. Null unless `status` is `preparing`.",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "start",
        "download",
        "upload",
        "extract",
        "convert",
        "summarise",
        "done"
      ]
    },
    "done": {
      "description": "Progress within the current phase: **bytes transferred** during `download`, and a count of files or tables otherwise. Null unless `status` is `preparing`.",
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "total": {
      "description": "The target `done` is counting towards, in the same unit, or 0 when it is not knowable in advance - a download whose response carries no Content-Length, for instance. Null unless `status` is `preparing`.",
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "detail": {
      "description": "The file or table currently being worked on; empty when there is none. Null unless `status` is `preparing`.",
      "type": [
        "string",
        "null"
      ]
    },
    "message": {
      "description": "Why the last attempt failed, in terms an operator can act on. Shown verbatim by the viewer, so it should name the actual cause. Null unless `status` is `failed`.",
      "type": [
        "string",
        "null"
      ]
    },
    "generated_at": {
      "description": "When the current set of files finished generating. Null unless `status` is `ready`.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}