# HG changeset patch # User Chris Cannam # Date 1474985009 -3600 # Node ID 30bd89a8cbeb8e1f1820da4c7585a69162048f74 # Parent b521ca16c51dd0b5d0333bd08be456ab9e30e1cf Instead of using separate values and b64values entries, allow numeric arrays to be replaced by b64 variants wherever they appear (discriminating by type). Also rename values to featureValues in feature, as values turns out to be a hazardous name in a JS context diff -r b521ca16c51d -r 30bd89a8cbeb examples/feature.json --- a/examples/feature.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/feature.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,1 +1,1 @@ -{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}} +{"featureValues": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}} diff -r b521ca16c51d -r 30bd89a8cbeb examples/featureset.json --- a/examples/featureset.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/featureset.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,1 +1,1 @@ -{"outputid": [{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}]} +{"outputid": [{"featureValues": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}]} diff -r b521ca16c51d -r 30bd89a8cbeb examples/processinput.json --- a/examples/processinput.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/processinput.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,1 +1,1 @@ -{"inputBuffers":[{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"}], "timestamp": {"n": 141590000, "s": 3}} +{"inputBuffers":["AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"], "timestamp": {"n": 141590000, "s": 3}} diff -r b521ca16c51d -r 30bd89a8cbeb examples/processrequest.json --- a/examples/processrequest.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/processrequest.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,1 +1,1 @@ -{"pluginHandle":12345,"processInput":{"inputBuffers":[{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"}], "timestamp": {"n": 141590000, "s": 3}}} +{"pluginHandle":12345,"processInput":{"inputBuffers":["AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"], "timestamp": {"n": 141590000, "s": 3}}} diff -r b521ca16c51d -r 30bd89a8cbeb examples/processresponse.json --- a/examples/processresponse.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/processresponse.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,2 +1,2 @@ -{"pluginHandle":12345,"features":{"outputid": [{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}]}} +{"pluginHandle":12345,"features":{"outputid": [{"featureValues": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}]}} diff -r b521ca16c51d -r 30bd89a8cbeb schema/feature.json --- a/schema/feature.json Tue Sep 27 11:19:19 2016 +0100 +++ b/schema/feature.json Tue Sep 27 15:03:29 2016 +0100 @@ -13,12 +13,17 @@ "label": { "type": "string" }, - "values": { - "type": "array", - "items": { "type": "number" } - }, - "b64values": { - "type": "string" + "featureValues": { + "anyOf": [ + { + "type": "array", + "items": { "type": "number" } + }, + { + "type": "string", + "pattern": "^[a-zA-Z0-9+/]*=*$" + } + ] } }, "additionalProperties": false diff -r b521ca16c51d -r 30bd89a8cbeb schema/processinput.json --- a/schema/processinput.json Tue Sep 27 11:19:19 2016 +0100 +++ b/schema/processinput.json Tue Sep 27 15:03:29 2016 +0100 @@ -10,16 +10,16 @@ "inputBuffers": { "type": "array", "items": { - "type": "object", - "properties": { - "values": { + "anyOf": [ + { "type": "array", "items": { "type": "number" } }, - "b64values": { - "type": "string" + { + "type": "string", + "pattern": "^[a-zA-Z0-9+/]*=*$" } - } + ] } } },