Last active
May 10, 2017 03:20
-
-
Save qdot/0c944c2ff542c0cd667775b36ca8b2ef to your computer and use it in GitHub Desktop.
Buttplug Message JSON Schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "Buttplug Messages", | |
"description": "The JSON Protocol format for the Buttplug Protocol", | |
"components" : { | |
"Id": { | |
"description": "User-set id for the message. 0 denotes system message and is reserved.", | |
"type": "integer", | |
"minimum": 0, | |
"maximum": 4294967295 | |
}, | |
"DeviceName": { | |
"description": "Name of the device", | |
"type": "string" | |
}, | |
"DeviceIndex": { | |
"description": "Index used for referencing the device in device messages.", | |
"type": "integer", | |
"minimum": 0 | |
}, | |
}, | |
"messages": { | |
"Ok": { | |
"type": "object", | |
"description": "Signifies successful processing of the message indicated by the id", | |
"properties": { | |
"Id": {"$ref": "#/components/Id"}, | |
}, | |
"additionalProperties": false, | |
"minProperties": 1, | |
"maxProperties": 1, | |
"required": [ | |
"Id" | |
] | |
}, | |
"Ping": { | |
"type": "object", | |
"description": "Connection keep-alive message", | |
"properties": { | |
"Id": {"$ref": "#/components/Id"}, | |
}, | |
"additionalProperties": false, | |
"minProperties": 1, | |
"maxProperties": 1, | |
"required": [ | |
"Id" | |
] | |
}, | |
"Error": { | |
"type": "object", | |
"description": "Signifies error processing of the message indicated by the id", | |
"properties": { | |
"Id": {"$ref": "#/components/Id"}, | |
"ErrorMessage": { | |
"type": "string" | |
} | |
}, | |
"additionalProperties": false, | |
"minProperties": 2, | |
"maxProperties": 2, | |
"required": [ | |
"Id", | |
"ErrorMessage" | |
] | |
}, | |
"Test": { | |
"type": "object", | |
"description": "Used for connection/application testing. Causes server to echo back the string sent. Sending string of 'Error' will result in a server error. ", | |
"properties": { | |
"Id": {"$ref": "#/components/Id"}, | |
"TestString": { | |
"description": "String to be echo'd back from server. Setting this to 'Error' will cause an error to be thrown.", | |
"type": "string" | |
} | |
}, | |
"minProperties": 2, | |
"maxProperties": 2, | |
"additionalProperties": false, | |
"required": [ | |
"Id", | |
"TestString" | |
] | |
}, | |
"DeviceList": { | |
"type": "object", | |
"description": "List of all available devices known to the system", | |
"properties": { | |
"Id": {"$ref": "#/components/Id"}, | |
"Devices": { | |
"description": "Array of device ids and names", | |
"type": "array", | |
"items": { | |
"properties": { | |
"DeviceName": { "$ref" : "#/components/DeviceName" }, | |
"DeviceIndex": { "$ref" : "#/components/DeviceIndex" } | |
}, | |
"minProperties": 2, | |
"maxProperties": 2, | |
"required": [ | |
"DeviceName", | |
"DeviceIndex" | |
], | |
"additionalProperties": false | |
} | |
} | |
}, | |
"minProperties": 2, | |
"maxProperties": 2, | |
"additionalProperties": false, | |
"required": [ | |
"Id", | |
"Devices" | |
] | |
}, | |
}, | |
"type": "array", | |
"items": { | |
"title": "Messages", | |
"description": "One or more messages validated by the Buttplug Message schema list", | |
"properties": { | |
"Ok": {"$ref": "#/messages/Ok"}, | |
"Error": {"$ref": "#/messages/Error"}, | |
"Ping": {"$ref": "#/messages/Ping"}, | |
"Test": {"$ref": "#/messages/Test"}, | |
"DeviceList": {"$ref": "#/messages/DeviceList"}, | |
}, | |
"additionalProperties": false, | |
"minProperties": 1, | |
"maxProperties": 1 | |
}, | |
"minItems": 1, | |
"additionalProperties": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment