{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/observeinc/json-schema/observeinc-reference-tables-table-schema.json",
  "title": "ReferenceTable",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/observeinc-referencetables-api-openapi.yml#/components/schemas/ReferenceTables-Table",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "int64"
    },
    "label": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "iconUrl": {
      "type": "string"
    },
    "managedById": {
      "type": "string",
      "format": "int64"
    },
    "customerId": {
      "type": "string",
      "format": "int64"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "$ref": "#/$defs/User"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedBy": {
      "$ref": "#/$defs/User"
    },
    "datasetId": {
      "type": "string",
      "format": "int64"
    },
    "checksum": {
      "type": "string"
    },
    "schema": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReferenceTables-Field"
      },
      "description": "The schema definition of the reference table"
    },
    "primaryKey": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The primary key columns of the reference table"
    },
    "labelField": {
      "type": "string",
      "description": "The field that should be used for the OPAL label"
    }
  },
  "$defs": {
    "ObjectId": {
      "type": "string",
      "format": "ObjectId"
    },
    "ReferenceTables-Field": {
      "title": "ReferenceTableField",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the field"
        },
        "type": {
          "type": "string",
          "description": "The type of the field (e.g., string, float64, array)"
        }
      },
      "required": [
        "name",
        "type"
      ]
    },
    "User": {
      "title": "User",
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "title": "User Identifier",
          "$ref": "#/$defs/ObjectId"
        },
        "label": {
          "title": "User Label",
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "locale": {
          "type": "string"
        }
      }
    }
  }
}