{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "jmri-json-server-message", "type": ["object", "array"], "description": "Message from JMRI to client", "definitions": { "jmri-json-server-message": { "anyOf": [ { "type": "object", "description": "Message from JMRI to client with data", "properties": { "type": { "type": "string", "description": "Data type if data is present, message type otherwise", "pattern": "^((?!(pong|goodbye)).)*$" }, "data": { "anyOf": [ { "type": "object", "description": "Data carried in message, see individual types for valid schemas" }, { "type": "array", "items": { "type": "object" } } ] }, "method": { "type": "string", "enum": ["get", "put", "post", "delete", "list"], "description": "HTTP Method equivalent advisory to the client to inform the client of a need to take an action on an object (for example, will be \"delete\" if advising a client that the client should delete an object that was deleted by the server); will not be present on objects merely being updated or added" }, "id": { "type": "integer", "description": "A message id previously assigned by the client and returned unmodified in messages in direct response to the message from the client" } }, "additionalProperties": false, "required": ["type", "data"] }, { "type": "object", "description": "Message from JMRI to client without data (only known types)", "properties": { "type": { "type": "string", "description": "Message type", "enum": ["pong", "goodbye"] } }, "additionalProperties": false, "required": ["type"] } ] } }, "anyOf": [ { "$ref": "#/definitions/jmri-json-server-message" }, { "type": "array", "description": "Multiple results in response to client message", "items": { "$ref": "#/definitions/jmri-json-server-message" } } ] }