{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/adro1b33/main/json-schema/adro1b33-geometry-version-detail-schema.json",
  "title": "GeometryVersionDetail",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adro1b33-geometry-versions-api-openapi.yml#/components/schemas/GeometryVersionDetail",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "uid": {
      "type": "string",
      "readOnly": true
    },
    "projectId": {
      "type": "integer",
      "readOnly": true
    },
    "versionNumber": {
      "type": "integer",
      "maximum": 2147483647,
      "minimum": 0
    },
    "name": {
      "type": "string",
      "maxLength": 255
    },
    "createdByUserId": {
      "type": [
        "integer",
        "null"
      ],
      "readOnly": true
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "snapshotSha256": {
      "type": "string",
      "maxLength": 64
    },
    "snapshot": {
      "allOf": [
        {
          "$ref": "#/$defs/GeometrySnapshot"
        }
      ],
      "readOnly": true
    },
    "artifactAccess": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GeometryArtifactAccess"
      },
      "readOnly": true
    }
  },
  "required": [
    "artifactAccess",
    "createdAt",
    "createdByUserId",
    "id",
    "name",
    "projectId",
    "snapshot",
    "snapshotSha256",
    "uid",
    "versionNumber"
  ],
  "$defs": {
    "GeometryArtifactAccess": {
      "type": "object",
      "properties": {
        "referenceId": {
          "type": "integer"
        },
        "patchUid": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "downloadUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "downloadUrl",
        "expiresAt",
        "patchUid",
        "referenceId",
        "role"
      ]
    },
    "GeometrySnapshot": {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "integer"
        },
        "projectUid": {
          "type": "string"
        },
        "patches": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GeometryVersionPatchSnapshot"
          }
        }
      },
      "required": [
        "patches",
        "projectUid",
        "schemaVersion"
      ]
    },
    "GeometryVersionArtifactSnapshot": {
      "type": "object",
      "properties": {
        "artifactUid": {
          "type": [
            "string",
            "null"
          ]
        },
        "role": {
          "type": "string"
        },
        "storageProvider": {
          "type": "string"
        },
        "s3Bucket": {
          "type": "string"
        },
        "s3Key": {
          "type": "string"
        },
        "sizeBytes": {
          "type": "integer"
        },
        "checksumSha256": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {}
        }
      },
      "required": [
        "artifactUid",
        "checksumSha256",
        "metadata",
        "role",
        "s3Bucket",
        "s3Key",
        "sizeBytes",
        "storageProvider"
      ]
    },
    "GeometryVersionPatchSnapshot": {
      "type": "object",
      "properties": {
        "patchIdSnapshot": {
          "type": [
            "integer",
            "null"
          ]
        },
        "patchUid": {
          "type": "string"
        },
        "patchType": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "sourcePatchUid": {
          "type": [
            "string",
            "null"
          ]
        },
        "mergedIntoPatchUid": {
          "type": [
            "string",
            "null"
          ]
        },
        "isMergeOutput": {
          "type": "boolean"
        },
        "mergedSourcePatchUids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "geometry": {
          "type": "object",
          "additionalProperties": {}
        },
        "constraints": {
          "type": "object",
          "additionalProperties": {}
        },
        "artifacts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GeometryVersionArtifactSnapshot"
          }
        }
      },
      "required": [
        "artifacts",
        "category",
        "constraints",
        "geometry",
        "isMergeOutput",
        "label",
        "mergedIntoPatchUid",
        "mergedSourcePatchUids",
        "patchIdSnapshot",
        "patchType",
        "patchUid",
        "sourcePatchUid"
      ]
    }
  }
}