{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.therealer.com/docs/api/schemas/http-feed-data-batch-request.schema.json",
  "title": "Realer HTTP feed-data batch request",
  "type": "object",
  "required": ["items"],
  "properties": {
    "items": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["value", "value_received_at", "message_id"],
        "oneOf": [
          { "required": ["command_id"] },
          { "required": ["sensor_id"] }
        ],
        "properties": {
          "command_id": { "type": "integer" },
          "sensor_id": { "type": "integer" },
          "value": { "type": "string" },
          "value_received_at": { "type": "string", "format": "date-time" },
          "message_id": { "type": "string" },
          "desired_id": { "type": "string" },
          "report_status": {
            "type": "string",
            "enum": ["reported", "applied", "rejected", "stale"]
          },
          "sequence_number": { "type": "integer" }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}
