{
  "$id": "https://schemas.sand.binaryedge.io/minion/modules/mqtt",
  "title": "MQTT Module Output Body",
  "type": "object",
  "properties": {
    "connected": {
      "type": "boolean"
    },
    "auth": {
      "type": "boolean"
    },
    "version": {
      "type": "number",
      "enum": [
        3,
        4,
        5
      ]
    },
    "protocol": {
      "type": "string",
      "enum": [
        "mqtt",
        "mqtts"
      ]
    },
    "connack": {
      "type": "object",
      "properties": {
        "cmd": {
          "type": "string"
        },
        "retain": {
          "type": "boolean"
        },
        "qos": {
          "type": "integer"
        },
        "dup": {
          "type": "boolean"
        },
        "length": {
          "type": "integer"
        },
        "topic": {
          "type": [
            "null",
            "string"
          ]
        },
        "payload": {
          "type": [
            "null",
            "string"
          ]
        },
        "sessionPresent": {
          "type": "boolean"
        },
        "returnCode": {
          "type": "integer"
        }
      },
      "required": [
        "cmd",
        "retain",
        "qos",
        "dup",
        "length",
        "sessionPresent",
        "returnCode"
      ],
      "additionalProperties": false
    },
    "bytes_captured": {
      "type": "integer"
    },
    "num_events": {
      "type": "integer"
    },
    "num_topics": {
      "type": "integer"
    },
    "topics": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "messages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/message"
      }
    }
  },
  "required": [
    "connected"
  ],
  "additionalProperties": false,
  "$defs": {
    "message": {
      "type": "object",
      "properties": {
        "topic": {
          "type": "string"
        },
        "msg": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  }
}
