{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/convert-online/json-schema/convert-online-job-schema.json",
  "title": "Job",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/convert-online-openapi.yml#/components/schemas/Job",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-f0-9]{32}$"
    },
    "tag": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "`waiting_upload` until the bytes arrive and `complete-upload` is called; then it queues, runs, and ends `finished` or `failed`.",
      "enum": [
        "waiting_upload",
        "waiting",
        "queued",
        "processing",
        "converting",
        "finished",
        "failed"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "startedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "endedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "tasks": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/TaskStatus"
      }
    },
    "result": {
      "type": [
        "object",
        "null"
      ],
      "description": "Present once the job has finished.",
      "additionalProperties": true
    },
    "error": {
      "type": "string",
      "description": "Why the job failed; empty otherwise."
    },
    "links": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string"
        }
      }
    }
  },
  "$defs": {
    "TaskStatus": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "job": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}