{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assetlab-ca/json-schema/assetlab-ca-building-schema.json",
  "title": "Building",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assetlab-ca-buildings-api-openapi.yml#/components/schemas/Building",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "floors": {
      "type": [
        "integer",
        "null"
      ]
    },
    "area_sqft": {
      "type": [
        "number",
        "null"
      ],
      "description": "Area in square feet"
    },
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "Building type label"
    },
    "building_type_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "year_built": {
      "type": [
        "integer",
        "null"
      ]
    },
    "latitude": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "minimum": -90,
      "maximum": 90,
      "description": "WGS 84 latitude in decimal degrees. Set together with longitude."
    },
    "longitude": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "minimum": -180,
      "maximum": 180,
      "description": "WGS 84 longitude in decimal degrees. Set together with latitude."
    },
    "site_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "sites": {
      "$ref": "#/$defs/SiteRef"
    },
    "archived_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Set when the building's site is archived; null when live. Read-only."
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "$defs": {
    "SiteRef": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}