{ "$schema": "http://json-schema.org/draft-07/schema#", "oneOf": [ { "title": "Device Connected", "description": "Schema for marking a device as connected", "type": "object", "properties": { "status": { "type": "string", "enum": [ "connected" ] }, "connectedAt": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "object", "properties": { "$date": { "type": "string" } }, "additionalProperties": false, "required": [ "$date" ] } ] }, "ipAddress": { "type": "string", "minLength": 2, "maxLength": 39 } }, "required": [ "status" ], "additionalProperties": false }, { "title": "Device Disconnected", "description": "Schema for marking a device as disconnected", "type": "object", "properties": { "status": { "type": "string", "enum": [ "disconnected" ] }, "connectedAt": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "object", "properties": { "$date": { "type": "string" } }, "additionalProperties": false, "required": [ "$date" ] } ] }, "disconnectedAt": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "object", "properties": { "$date": { "type": "string" } }, "additionalProperties": false, "required": [ "$date" ] } ] }, "disconnectReason": { "type": "string", "maxLength": 1024 }, "messagesFromClient": { "type": "number" }, "messagesToClient": { "type": "number" }, "ipAddress": { "type": "string", "minLength": 2, "maxLength": 39 } }, "required": [ "status" ], "additionalProperties": false } ] }