{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/dexcom/refs/heads/main/json-schema/dexcom-api-calibration-record-schema.json",
  "title": "CalibrationRecord",
  "description": "CalibrationRecord schema from Dexcom Developer API",
  "type": "object",
  "properties": {
    "recordId": {
      "type": "string"
    },
    "systemTime": {
      "$ref": "#/$defs/DateTime"
    },
    "displayTime": {
      "$ref": "#/$defs/DateTime"
    },
    "unit": {
      "$ref": "#/$defs/GlucoseUnit"
    },
    "value": {
      "type": "integer",
      "format": "int32"
    },
    "displayDevice": {
      "type": "string"
    },
    "transmitterId": {
      "type": "string",
      "nullable": true
    },
    "transmitterTicks": {
      "type": "integer",
      "format": "int64"
    },
    "transmitterGeneration": {
      "$ref": "#/$defs/TransmitterGeneration"
    }
  },
  "$defs": {
    "DateTime": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp."
    },
    "TransmitterGeneration": {
      "type": "string",
      "enum": [
        "unknown",
        "g4",
        "g5",
        "g6",
        "g6+",
        "dexcomPro",
        "g7"
      ]
    },
    "GlucoseUnit": {
      "type": "string",
      "enum": [
        "unknown",
        "mg/dL",
        "mmol/L"
      ]
    }
  }
}
