changeset 68:5d50f7c9afc6 jsonrpc

Merge from branch docrefactor
author Chris Cannam
date Wed, 05 Oct 2016 09:59:18 +0100
parents 8f3ba64ec888 (current diff) ada4cd9daaba (diff)
children 9e3ea87dad6e
files examples/feature.json examples/processinput.json
diffstat 12 files changed, 34 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/feature-array.json	Wed Oct 05 09:59:18 2016 +0100
@@ -0,0 +1,1 @@
+{"featureValues": [ 1.0, -1.0, 4.0, 1505050.50 ], "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/feature-base64.json	Wed Oct 05 09:59:18 2016 +0100
@@ -0,0 +1,1 @@
+{"featureValues": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}
--- a/examples/feature.json	Wed Oct 05 09:19:05 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-{"featureValues": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/processinput-array.json	Wed Oct 05 09:59:18 2016 +0100
@@ -0,0 +1,1 @@
+{"inputBuffers":[[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], "timestamp": {"n": 141590000, "s": 3}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/processinput-base64.json	Wed Oct 05 09:59:18 2016 +0100
@@ -0,0 +1,1 @@
+{"inputBuffers":["AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"], "timestamp": {"n": 141590000, "s": 3}}
--- a/examples/processinput.json	Wed Oct 05 09:19:05 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-{"inputBuffers":["AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"], "timestamp": {"n": 141590000, "s": 3}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/serialisedarray-array.json	Wed Oct 05 09:59:18 2016 +0100
@@ -0,0 +1,1 @@
+[1,2,-3,3.1415926537]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/serialisedarray-base64.json	Wed Oct 05 09:59:18 2016 +0100
@@ -0,0 +1,1 @@
+"AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"
--- a/schema/feature.json	Wed Oct 05 09:19:05 2016 +0100
+++ b/schema/feature.json	Wed Oct 05 09:59:18 2016 +0100
@@ -14,16 +14,7 @@
 	    "type": "string"
 	},
 	"featureValues": {
-            "anyOf": [
-                {
-		    "type": "array",
-		    "items": { "type": "number" }
-		},
-                {
-		    "type": "string",
-                    "pattern": "^[a-zA-Z0-9+/]*=*$"
-		}
-            ]
+            "$ref": "http://vamp-plugins.org/json/schema/serialisedarray#"
 	}
     },
     "additionalProperties": false
--- a/schema/processinput.json	Wed Oct 05 09:19:05 2016 +0100
+++ b/schema/processinput.json	Wed Oct 05 09:59:18 2016 +0100
@@ -10,18 +10,9 @@
 	"inputBuffers": {
 	    "type": "array",
 	    "items": {
-                "anyOf": [
-                    {
-			"type": "array",
-			"items": { "type": "number" }
-		    },
-                    {
-		        "type": "string",
-                        "pattern": "^[a-zA-Z0-9+/]*=*$"
-		    }
-                ]
-	    }
-	}
+                "$ref": "http://vamp-plugins.org/json/schema/serialisedarray#"
+            }
+        }
     },
     "additionalProperties": false
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/serialisedarray.json	Wed Oct 05 09:59:18 2016 +0100
@@ -0,0 +1,20 @@
+{
+    "id": "http://vamp-plugins.org/json/schema/serialisedarray#",
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "description": "schema for alternate serialisations of an array of floating-point values",
+    "anyOf": [
+        {
+	    "type": "array",
+	    "items": { "type": "number" }
+	},
+        {
+	    "type": "string",
+            "media": {
+                "binaryEncoding": "base64",
+                "type": "application/octet-stream"
+            }
+	}
+    ]
+}
+
+	
--- a/test.sh	Wed Oct 05 09:19:05 2016 +0100
+++ b/test.sh	Wed Oct 05 09:59:18 2016 +0100
@@ -1,15 +1,16 @@
 #!/bin/bash
 
-set -eu
 
 for ex in examples/*.json ; do
     echo "Checking $ex..." 1>&2
-    jsonschema -i "$ex" schema/$(basename "$ex")
+    jsonschema -i "$ex" schema/$(basename "$ex" | sed 's/-[^.]*//')
 done
 
 for s in schema/*.json ; do
     if [ ! -f examples/$(basename "$s") ]; then
-	echo "WARNING: No example file for schema $s"
+        if ! ls -1 examples/$(basename "$s" .json)-*.json >/dev/null 2>&1; then
+	    echo "WARNING: No example file for schema $s"
+        fi
     fi
 done