{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.therealer.com/docs/api/schemas/mqtt-desired-state.schema.json",
  "title": "Realer MQTT command desired-state payload",
  "type": "object",
  "required": [
    "version",
    "desired_id",
    "device_id",
    "route_id",
    "resource_id",
    "source_type",
    "source_id",
    "value",
    "issued_at",
    "valid_for_seconds",
    "expires_at",
    "sequence_number",
    "metadata"
  ],
  "properties": {
    "version": {
      "type": "string",
      "const": "iot.v1.mqtt.command_desired"
    },
    "desired_id": { "type": "string" },
    "device_id": { "type": "string" },
    "route_id": { "type": "string" },
    "resource_id": { "type": "string" },
    "source_type": {
      "type": "string",
      "const": "command"
    },
    "source_id": { "type": "string" },
    "value": { "type": "string" },
    "issued_at": { "type": "string", "format": "date-time" },
    "valid_for_seconds": { "type": "integer" },
    "expires_at": { "type": "string", "format": "date-time" },
    "sequence_number": { "type": "integer" },
    "metadata": { "type": "object" }
  },
  "additionalProperties": true
}
