{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-deployment-page-response-schema.json",
  "title": "DeploymentPageResponse",
  "description": "Cursor-paginated deployment history.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logbrew-releases-api-openapi.yml#/components/schemas/DeploymentPageResponse",
  "properties": {
    "deployments": {
      "description": "Deployment boundaries in newest-finished-first order.",
      "items": {
        "$ref": "#/$defs/DeploymentResponse"
      },
      "type": "array"
    },
    "next_cursor": {
      "anyOf": [
        {
          "$ref": "#/$defs/DeploymentCursorResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "Exclusive continuation key when another page exists."
    },
    "schema_version": {
      "description": "Additive response schema version.",
      "format": "uint8",
      "maximum": 255,
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "schema_version",
    "deployments",
    "next_cursor"
  ],
  "type": "object",
  "$defs": {
    "DeploymentCursorResponse": {
      "description": "Complete exclusive deployment-history continuation key.",
      "properties": {
        "id": {
          "description": "Stable internal UUID of the final deployment in the current page.",
          "format": "uuid",
          "type": "string"
        },
        "time": {
          "description": "Finish time of the final deployment in the current page.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "time",
        "id"
      ],
      "type": "object"
    },
    "DeploymentResponse": {
      "description": "One canonical deployment boundary returned by capture or reads.",
      "properties": {
        "commit_sha": {
          "description": "Lowercase abbreviated or full hexadecimal source commit identity.",
          "type": [
            "string",
            "null"
          ]
        },
        "deployment_id": {
          "description": "Caller-owned external deployment identity.",
          "type": "string"
        },
        "environment": {
          "description": "Exact deployment environment.",
          "type": "string"
        },
        "finished_at": {
          "description": "Millisecond-normalized deployment finish.",
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "description": "Stable internal UUID derived from project and external deployment identity.",
          "format": "uuid",
          "type": "string"
        },
        "project_id": {
          "description": "Owning project identifier.",
          "format": "uuid",
          "type": "string"
        },
        "recorded_at": {
          "description": "Time `LogBrew` first durably accepted this deployment identity.",
          "format": "date-time",
          "type": "string"
        },
        "release": {
          "description": "Exact application release.",
          "type": "string"
        },
        "schema_version": {
          "description": "Additive response schema version.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "service_name": {
          "description": "Exact logical service name.",
          "type": "string"
        },
        "started_at": {
          "description": "Millisecond-normalized deployment start.",
          "format": "date-time",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/DeploymentStatus",
          "description": "Terminal deployment result."
        }
      },
      "required": [
        "schema_version",
        "id",
        "deployment_id",
        "project_id",
        "release",
        "environment",
        "service_name",
        "status",
        "started_at",
        "finished_at",
        "commit_sha",
        "recorded_at"
      ],
      "type": "object"
    },
    "DeploymentStatus": {
      "description": "Terminal result of one completed deployment attempt.",
      "oneOf": [
        {
          "const": "succeeded",
          "description": "The deployment completed successfully.",
          "type": "string"
        },
        {
          "const": "failed",
          "description": "The deployment attempt completed unsuccessfully.",
          "type": "string"
        }
      ]
    }
  }
}