changeset 70:f8b72a20cfcd jsonrpc

Restore type (i.e. method) field to response
author Chris Cannam
date Wed, 05 Oct 2016 11:54:04 +0100
parents 9e3ea87dad6e
children d1638aefce5d
files examples/response-error.json examples/response-ok.json schema/response.json
diffstat 3 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/examples/response-error.json	Wed Oct 05 11:16:03 2016 +0100
+++ b/examples/response-error.json	Wed Oct 05 11:54:04 2016 +0100
@@ -1,1 +1,1 @@
-{"error": {"code": 6, "message": "An error occurred!" },"id": "6"}
+{"method": "process", "error": {"code": 6, "message": "An error occurred!" },"id": "6"}
--- a/examples/response-ok.json	Wed Oct 05 11:16:03 2016 +0100
+++ b/examples/response-ok.json	Wed Oct 05 11:54:04 2016 +0100
@@ -1,1 +1,1 @@
-{"result": {"pluginHandle":12345,"staticData":{"basic": {"description": "Detect percussive note onsets by identifying broadband energy rises", "identifier": "percussiononsets", "name": "Simple Percussion Onset Detector"}, "basicOutputInfo": [{"description": "Percussive note onset locations", "identifier": "onsets", "name": "Onsets"}, {"description": "Broadband energy rise detection function", "identifier": "detectionfunction", "name": "Detection Function"}], "category": ["Time", "Onsets"], "copyright": "Code copyright 2006 Queen Mary, University of London, after Dan Barry et al 2005.  Freely redistributable (BSD license)", "inputDomain": "FrequencyDomain", "pluginKey": "vamp-example-plugins:percussiononsets", "maker": "Vamp SDK Example Plugins", "maxChannelCount": 1, "minChannelCount": 1, "parameters": [{"basic": {"description": "Energy rise within a frequency bin necessary to count toward broadband total", "identifier": "threshold", "name": "Energy rise threshold"}, "defaultValue": 3, "extents": {"max": 20, "min": 0}, "unit": "dB", "valueNames": []}, {"basic": {"description": "Sensitivity of peak detector applied to broadband detection function", "identifier": "sensitivity", "name": "Sensitivity"}, "defaultValue": 40, "extents": {"max": 100, "min": 0}, "unit": "%", "valueNames": []}], "programs": [], "pluginVersion": 2},"defaultConfiguration":{"blockSize": 512, "channelCount": 2, "parameterValues": {"sensitivity": 40, "threshold": 3}, "stepSize": 1024}},"id": "6"}
+{"method": "load", "result": {"pluginHandle":12345,"staticData":{"basic": {"description": "Detect percussive note onsets by identifying broadband energy rises", "identifier": "percussiononsets", "name": "Simple Percussion Onset Detector"}, "basicOutputInfo": [{"description": "Percussive note onset locations", "identifier": "onsets", "name": "Onsets"}, {"description": "Broadband energy rise detection function", "identifier": "detectionfunction", "name": "Detection Function"}], "category": ["Time", "Onsets"], "copyright": "Code copyright 2006 Queen Mary, University of London, after Dan Barry et al 2005.  Freely redistributable (BSD license)", "inputDomain": "FrequencyDomain", "pluginKey": "vamp-example-plugins:percussiononsets", "maker": "Vamp SDK Example Plugins", "maxChannelCount": 1, "minChannelCount": 1, "parameters": [{"basic": {"description": "Energy rise within a frequency bin necessary to count toward broadband total", "identifier": "threshold", "name": "Energy rise threshold"}, "defaultValue": 3, "extents": {"max": 20, "min": 0}, "unit": "dB", "valueNames": []}, {"basic": {"description": "Sensitivity of peak detector applied to broadband detection function", "identifier": "sensitivity", "name": "Sensitivity"}, "defaultValue": 40, "extents": {"max": 100, "min": 0}, "unit": "%", "valueNames": []}], "programs": [], "pluginVersion": 2},"defaultConfiguration":{"blockSize": 512, "channelCount": 2, "parameterValues": {"sensitivity": 40, "threshold": 3}, "stepSize": 1024}},"id": "6"}
--- a/schema/response.json	Wed Oct 05 11:16:03 2016 +0100
+++ b/schema/response.json	Wed Oct 05 11:54:04 2016 +0100
@@ -5,6 +5,9 @@
     "type": "object",
     "oneOf": [ {
         "properties": {
+	    "method": {
+	        "type": "string"
+	    },
 	    "result": {
                 "anyOf": [
                     { "$ref": "http://vamp-plugins.org/json/schema/listresponse#" },
@@ -24,10 +27,13 @@
                 "type": "string"
             }
         },
-        "required": [ "result" ],
+        "required": [ "method", "result" ],
         "additionalProperties": false
     }, {
         "properties": {
+	    "method": {
+	        "type": "string"
+	    },
 	    "error": {
                 "$ref": "http://vamp-plugins.org/json/schema/error#"
 	    },
@@ -41,7 +47,7 @@
                 "type": "string"
             }
         },
-        "required": [ "error" ],
+        "required": [ "method", "error" ],
         "additionalProperties": false
     } ]
 }